Commit 501af8d1 authored by Kulikov Vasiliy's avatar Kulikov Vasiliy Committed by Jiri Kosina
Browse files

scsi: bfa: use ARRAY_SIZE



Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x).

Signed-off-by: default avatarKulikov Vasiliy <segooon@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 04ad327f
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -335,7 +335,7 @@ bfa_get_pciids(struct bfa_pciid_s **pciids, int *npciids)
		{BFA_PCI_VENDOR_ID_BROCADE, BFA_PCI_DEVICE_ID_CT},
		{BFA_PCI_VENDOR_ID_BROCADE, BFA_PCI_DEVICE_ID_CT},
	};
	};


	*npciids = sizeof(__pciids) / sizeof(__pciids[0]);
	*npciids = ARRAY_SIZE(__pciids);
	*pciids = __pciids;
	*pciids = __pciids;
}
}


+4 −6
Original line number Original line Diff line number Diff line
@@ -86,7 +86,7 @@ bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa, struct bfad_s *bfad,
	bfa_attach_fcs(bfa);
	bfa_attach_fcs(bfa);
	fcbuild_init();
	fcbuild_init();


	for (i = 0; i < sizeof(fcs_modules) / sizeof(fcs_modules[0]); i++) {
	for (i = 0; i < ARRAY_SIZE(fcs_modules); i++) {
		mod = &fcs_modules[i];
		mod = &fcs_modules[i];
		if (mod->attach)
		if (mod->attach)
			mod->attach(fcs);
			mod->attach(fcs);
@@ -102,7 +102,7 @@ bfa_fcs_init(struct bfa_fcs_s *fcs)
	int             i;
	int             i;
	struct bfa_fcs_mod_s  *mod;
	struct bfa_fcs_mod_s  *mod;


	for (i = 0; i < sizeof(fcs_modules) / sizeof(fcs_modules[0]); i++) {
	for (i = 0; i < ARRAY_SIZE(fcs_modules); i++) {
		mod = &fcs_modules[i];
		mod = &fcs_modules[i];
		if (mod->modinit)
		if (mod->modinit)
			mod->modinit(fcs);
			mod->modinit(fcs);
@@ -163,13 +163,11 @@ void
bfa_fcs_exit(struct bfa_fcs_s *fcs)
bfa_fcs_exit(struct bfa_fcs_s *fcs)
{
{
	struct bfa_fcs_mod_s  *mod;
	struct bfa_fcs_mod_s  *mod;
	int             nmods, i;
	int i;


	bfa_wc_init(&fcs->wc, bfa_fcs_exit_comp, fcs);
	bfa_wc_init(&fcs->wc, bfa_fcs_exit_comp, fcs);


	nmods = sizeof(fcs_modules) / sizeof(fcs_modules[0]);
	for (i = 0; i < ARRAY_SIZE(fcs_modules); i++) {

	for (i = 0; i < nmods; i++) {


		mod = &fcs_modules[i];
		mod = &fcs_modules[i];
		if (mod->modexit) {
		if (mod->modexit) {