diff options
author | Dan Williams <dan.j.williams@intel.com> | 2011-03-07 16:02:25 -0800 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 03:55:29 -0700 |
commit | b329aff107543c3c4db26c1572405034c3baf906 (patch) | |
tree | 96a9a1f4faa899f8b384a50172bd49f160acb7f7 /drivers/scsi/isci/host.h | |
parent | 52bed8eab5d392183b77426b96551011f3521ef8 (diff) |
isci: kill isci_host list in favor of an array
isci_host_by_id() should have been a clue that an array would have been
a simpler approach.
Reported-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/host.h')
-rw-r--r-- | drivers/scsi/isci/host.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/scsi/isci/host.h b/drivers/scsi/isci/host.h index ef3e7d1440b..7c1f0b5cee7 100644 --- a/drivers/scsi/isci/host.h +++ b/drivers/scsi/isci/host.h @@ -117,7 +117,6 @@ struct isci_host { struct list_head requests_to_complete; struct list_head requests_to_abort; spinlock_t scic_lock; - struct isci_host *next; }; @@ -131,7 +130,7 @@ struct isci_host { struct isci_pci_info { struct msix_entry msix_entries[SCI_MAX_MSIX_INT]; int core_lib_array_index; - struct isci_host *hosts; + struct isci_host *hosts[SCI_MAX_CONTROLLERS]; }; static inline struct isci_pci_info *to_pci_info(struct pci_dev *pdev) @@ -139,9 +138,10 @@ static inline struct isci_pci_info *to_pci_info(struct pci_dev *pdev) return pci_get_drvdata(pdev); } -#define for_each_isci_host(isci_host, pdev) \ - for (isci_host = to_pci_info(pdev)->hosts;\ - isci_host; isci_host = isci_host->next) +#define for_each_isci_host(id, ihost, pdev) \ + for (id = 0, ihost = to_pci_info(pdev)->hosts[id]; \ + id < ARRAY_SIZE(to_pci_info(pdev)->hosts) && ihost; \ + ihost = to_pci_info(pdev)->hosts[++id]) static inline enum isci_status isci_host_get_state( |