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

Commit 44416c42 authored by Fabian Frederick's avatar Fabian Frederick Committed by Christoph Hellwig
Browse files

bfa: use ARRAY_SIZE instead of sizeof/sizeof[0]



Use macro definition

Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Acked-by: default avatarAnil Gurumurthy <anil.gurumurthy@qlogic.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 0e772b33
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -81,7 +81,7 @@ bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa, struct bfad_s *bfad,
	bfa->fcs = BFA_TRUE;
	bfa->fcs = BFA_TRUE;
	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);
@@ -97,7 +97,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);
@@ -184,7 +184,7 @@ bfa_fcs_exit(struct bfa_fcs_s *fcs)


	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]);
	nmods = ARRAY_SIZE(fcs_modules);


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