aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa
diff options
context:
space:
mode:
authorKulikov Vasiliy <segooon@gmail.com>2010-06-28 07:55:04 -0400
committerJiri Kosina <jkosina@suse.cz>2010-07-20 11:14:35 -0400
commit501af8d110f1fca597ff61c8611d018360ff9bf7 (patch)
treee77fd76711af547b82cd5885642eaf5b116ab0ac /drivers/scsi/bfa
parent04ad327f277ec3bc3c05f5a5c19d58600882d38e (diff)
scsi: bfa: use ARRAY_SIZE
Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x). Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/scsi/bfa')
-rw-r--r--drivers/scsi/bfa/bfa_core.c2
-rw-r--r--drivers/scsi/bfa/bfa_fcs.c10
2 files changed, 5 insertions, 7 deletions
diff --git a/drivers/scsi/bfa/bfa_core.c b/drivers/scsi/bfa/bfa_core.c
index 3a7b3f88932f..d84550636add 100644
--- a/drivers/scsi/bfa/bfa_core.c
+++ b/drivers/scsi/bfa/bfa_core.c
@@ -335,7 +335,7 @@ bfa_get_pciids(struct bfa_pciid_s **pciids, int *npciids)
335 {BFA_PCI_VENDOR_ID_BROCADE, BFA_PCI_DEVICE_ID_CT}, 335 {BFA_PCI_VENDOR_ID_BROCADE, BFA_PCI_DEVICE_ID_CT},
336 }; 336 };
337 337
338 *npciids = sizeof(__pciids) / sizeof(__pciids[0]); 338 *npciids = ARRAY_SIZE(__pciids);
339 *pciids = __pciids; 339 *pciids = __pciids;
340} 340}
341 341
diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c
index 3516172c597c..153cb2a3ffe3 100644
--- a/drivers/scsi/bfa/bfa_fcs.c
+++ b/drivers/scsi/bfa/bfa_fcs.c
@@ -86,7 +86,7 @@ bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa, struct bfad_s *bfad,
86 bfa_attach_fcs(bfa); 86 bfa_attach_fcs(bfa);
87 fcbuild_init(); 87 fcbuild_init();
88 88
89 for (i = 0; i < sizeof(fcs_modules) / sizeof(fcs_modules[0]); i++) { 89 for (i = 0; i < ARRAY_SIZE(fcs_modules); i++) {
90 mod = &fcs_modules[i]; 90 mod = &fcs_modules[i];
91 if (mod->attach) 91 if (mod->attach)
92 mod->attach(fcs); 92 mod->attach(fcs);
@@ -102,7 +102,7 @@ bfa_fcs_init(struct bfa_fcs_s *fcs)
102 int i; 102 int i;
103 struct bfa_fcs_mod_s *mod; 103 struct bfa_fcs_mod_s *mod;
104 104
105 for (i = 0; i < sizeof(fcs_modules) / sizeof(fcs_modules[0]); i++) { 105 for (i = 0; i < ARRAY_SIZE(fcs_modules); i++) {
106 mod = &fcs_modules[i]; 106 mod = &fcs_modules[i];
107 if (mod->modinit) 107 if (mod->modinit)
108 mod->modinit(fcs); 108 mod->modinit(fcs);
@@ -163,13 +163,11 @@ void
163bfa_fcs_exit(struct bfa_fcs_s *fcs) 163bfa_fcs_exit(struct bfa_fcs_s *fcs)
164{ 164{
165 struct bfa_fcs_mod_s *mod; 165 struct bfa_fcs_mod_s *mod;
166 int nmods, i; 166 int i;
167 167
168 bfa_wc_init(&fcs->wc, bfa_fcs_exit_comp, fcs); 168 bfa_wc_init(&fcs->wc, bfa_fcs_exit_comp, fcs);
169 169
170 nmods = sizeof(fcs_modules) / sizeof(fcs_modules[0]); 170 for (i = 0; i < ARRAY_SIZE(fcs_modules); i++) {
171
172 for (i = 0; i < nmods; i++) {
173 171
174 mod = &fcs_modules[i]; 172 mod = &fcs_modules[i];
175 if (mod->modexit) { 173 if (mod->modexit) {