Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57f20f4e authored by Dan Williams's avatar Dan Williams
Browse files

isci: unify remote_device data structures



Make it explicit that isci_remote_device and scic_sds_remote_device are
one in the same object.

Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 9614395e
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -86,18 +86,6 @@ enum scic_remote_device_not_ready_reason_code {

};

/**
 * scic_remote_device_get_object_size() - This method simply returns the
 *    maximum memory space needed to store a remote device object.
 *
 * a positive integer value indicating the size (in bytes) of the remote device
 * object.
 */
u32 scic_remote_device_get_object_size(
	void);

struct scic_sds_port;
struct scic_sds_remote_device;
/**
 * scic_remote_device_construct() - This method will perform the construction
 *    common to all remote device objects.
+0 −15
Original line number Diff line number Diff line
@@ -71,21 +71,6 @@

#define SCIC_SDS_REMOTE_DEVICE_RESET_TIMEOUT  (1000)

/*
 * *****************************************************************************
 * *  CORE REMOTE DEVICE PRIVATE METHODS
 * ***************************************************************************** */

/*
 * *****************************************************************************
 * *  CORE REMOTE DEVICE PUBLIC METHODS
 * ***************************************************************************** */

u32 scic_remote_device_get_object_size(void)
{
	return sizeof (struct scic_sds_remote_device);
}

enum sci_status scic_remote_device_da_construct(
	struct scic_sds_remote_device *sci_dev)
{
+1 −1
Original line number Diff line number Diff line
@@ -467,7 +467,7 @@ int isci_host_init(struct isci_host *isci_host)
		isci_phy_init(&isci_host->phys[i], isci_host, i);

	for (i = 0; i < SCI_MAX_REMOTE_DEVICES; i++) {
		struct isci_remote_device *idev = idev_by_id(isci_host, i);
		struct isci_remote_device *idev = &isci_host->devices[i];

		INIT_LIST_HEAD(&idev->reqs_in_process);
		INIT_LIST_HEAD(&idev->node);
+1 −10
Original line number Diff line number Diff line
@@ -110,18 +110,9 @@ struct isci_host {
	struct list_head requests_to_errorback;
	spinlock_t scic_lock;

	/* careful only access this via idev_by_id */
	struct isci_remote_device devices[0];
	struct isci_remote_device devices[SCI_MAX_REMOTE_DEVICES];
};

static inline struct isci_remote_device *idev_by_id(struct isci_host *ihost, int i)
{
	void *p = ihost->devices;

	return p + i * (sizeof(struct isci_remote_device) +
			scic_remote_device_get_object_size());
}

/**
 * struct isci_pci_info - This class represents the pci function containing the
 *    controllers. Depending on PCI SKU, there could be up to 2 controllers in
+1 −4
Original line number Diff line number Diff line
@@ -396,10 +396,7 @@ static struct isci_host *isci_host_alloc(struct pci_dev *pdev, int id)
	struct Scsi_Host *shost;
	int err;

	isci_host = devm_kzalloc(&pdev->dev, sizeof(*isci_host) +
				 SCI_MAX_REMOTE_DEVICES *
				 (sizeof(struct isci_remote_device) +
				  scic_remote_device_get_object_size()), GFP_KERNEL);
	isci_host = devm_kzalloc(&pdev->dev, sizeof(*isci_host), GFP_KERNEL);
	if (!isci_host)
		return NULL;

Loading