diff options
author | Bhanu Prakash Gollapudi <bprakash@broadcom.com> | 2012-06-07 05:19:36 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-07-20 03:58:24 -0400 |
commit | d71fb3bdeee80565eda4d3453ff6d9f6f8176745 (patch) | |
tree | 2b2e1c6a92a201348d3d0862271f864d60841ef7 /drivers/scsi/bnx2fc/bnx2fc_fcoe.c | |
parent | 5c17ae217ad13463f821c3bab774335777da9c33 (diff) |
[SCSI] bnx2fc: use list_entry instead of explicit cast
Use list_for_each_entry_safe() instead of explicit cast to avoid relying on
struct layout
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bnx2fc/bnx2fc_fcoe.c')
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 17ab9f7d2e26..0c9caa6747ae 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c | |||
@@ -2151,13 +2151,10 @@ mod_err: | |||
2151 | **/ | 2151 | **/ |
2152 | static struct bnx2fc_hba *bnx2fc_find_hba_for_cnic(struct cnic_dev *cnic) | 2152 | static struct bnx2fc_hba *bnx2fc_find_hba_for_cnic(struct cnic_dev *cnic) |
2153 | { | 2153 | { |
2154 | struct list_head *list; | ||
2155 | struct list_head *temp; | ||
2156 | struct bnx2fc_hba *hba; | 2154 | struct bnx2fc_hba *hba; |
2157 | 2155 | ||
2158 | /* Called with bnx2fc_dev_lock held */ | 2156 | /* Called with bnx2fc_dev_lock held */ |
2159 | list_for_each_safe(list, temp, &adapter_list) { | 2157 | list_for_each_entry(hba, &adapter_list, list) { |
2160 | hba = (struct bnx2fc_hba *)list; | ||
2161 | if (hba->cnic == cnic) | 2158 | if (hba->cnic == cnic) |
2162 | return hba; | 2159 | return hba; |
2163 | } | 2160 | } |