All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] [SCSI] bfa: use ARRAY_SIZE instead of sizeof/sizeof[0]
@ 2014-06-30 17:42 Fabian Frederick
  2014-07-02  5:16   ` Anil Gurumurthy
  0 siblings, 1 reply; 3+ messages in thread
From: Fabian Frederick @ 2014-06-30 17:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: Fabian Frederick, Anil Gurumurthy, Sudarsana Kalluru,
	James E.J. Bottomley, linux-scsi

Use macro definition

Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Cc: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 drivers/scsi/bfa/bfa_fcs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c
index a3ab5cc..0f19455 100644
--- a/drivers/scsi/bfa/bfa_fcs.c
+++ b/drivers/scsi/bfa/bfa_fcs.c
@@ -81,7 +81,7 @@ bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa, struct bfad_s *bfad,
 	bfa->fcs = BFA_TRUE;
 	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];
 		if (mod->attach)
 			mod->attach(fcs);
@@ -97,7 +97,7 @@ bfa_fcs_init(struct bfa_fcs_s *fcs)
 	int	i;
 	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];
 		if (mod->modinit)
 			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);
 
-	nmods = sizeof(fcs_modules) / sizeof(fcs_modules[0]);
+	nmods = ARRAY_SIZE(fcs_modules);
 
 	for (i = 0; i < nmods; i++) {
 
-- 
1.8.4.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH 1/1] [SCSI] bfa: use ARRAY_SIZE instead of sizeof/sizeof[0]
  2014-06-30 17:42 [PATCH 1/1] [SCSI] bfa: use ARRAY_SIZE instead of sizeof/sizeof[0] Fabian Frederick
@ 2014-07-02  5:16   ` Anil Gurumurthy
  0 siblings, 0 replies; 3+ messages in thread
From: Anil Gurumurthy @ 2014-07-02  5:16 UTC (permalink / raw)
  To: Fabian Frederick, linux-kernel
  Cc: Sudarsana Kalluru, James E.J. Bottomley, linux-scsi

Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>


-----Original Message-----
From: Fabian Frederick [mailto:fabf@skynet.be]
Sent: 30 June 2014 23:13
To: linux-kernel
Cc: Fabian Frederick; Anil Gurumurthy; Sudarsana Kalluru; James E.J. Bottomley; linux-scsi
Subject: [PATCH 1/1] [SCSI] bfa: use ARRAY_SIZE instead of sizeof/sizeof[0]

Use macro definition

Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Cc: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 drivers/scsi/bfa/bfa_fcs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c index a3ab5cc..0f19455 100644
--- a/drivers/scsi/bfa/bfa_fcs.c
+++ b/drivers/scsi/bfa/bfa_fcs.c
@@ -81,7 +81,7 @@ bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa, struct bfad_s *bfad,
        bfa->fcs = BFA_TRUE;
        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];
                if (mod->attach)
                        mod->attach(fcs);
@@ -97,7 +97,7 @@ bfa_fcs_init(struct bfa_fcs_s *fcs)
        int     i;
        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];
                if (mod->modinit)
                        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);

-       nmods = sizeof(fcs_modules) / sizeof(fcs_modules[0]);
+       nmods = ARRAY_SIZE(fcs_modules);

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

--
1.8.4.5


________________________________

This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH 1/1] [SCSI] bfa: use ARRAY_SIZE instead of sizeof/sizeof[0]
@ 2014-07-02  5:16   ` Anil Gurumurthy
  0 siblings, 0 replies; 3+ messages in thread
From: Anil Gurumurthy @ 2014-07-02  5:16 UTC (permalink / raw)
  To: Fabian Frederick, linux-kernel
  Cc: Sudarsana Kalluru, James E.J. Bottomley, linux-scsi

[-- Attachment #1: Type: text/plain, Size: 2349 bytes --]

Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>


-----Original Message-----
From: Fabian Frederick [mailto:fabf@skynet.be]
Sent: 30 June 2014 23:13
To: linux-kernel
Cc: Fabian Frederick; Anil Gurumurthy; Sudarsana Kalluru; James E.J. Bottomley; linux-scsi
Subject: [PATCH 1/1] [SCSI] bfa: use ARRAY_SIZE instead of sizeof/sizeof[0]

Use macro definition

Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Cc: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 drivers/scsi/bfa/bfa_fcs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c index a3ab5cc..0f19455 100644
--- a/drivers/scsi/bfa/bfa_fcs.c
+++ b/drivers/scsi/bfa/bfa_fcs.c
@@ -81,7 +81,7 @@ bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa, struct bfad_s *bfad,
        bfa->fcs = BFA_TRUE;
        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];
                if (mod->attach)
                        mod->attach(fcs);
@@ -97,7 +97,7 @@ bfa_fcs_init(struct bfa_fcs_s *fcs)
        int     i;
        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];
                if (mod->modinit)
                        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);

-       nmods = sizeof(fcs_modules) / sizeof(fcs_modules[0]);
+       nmods = ARRAY_SIZE(fcs_modules);

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

--
1.8.4.5


________________________________

This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.

[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 4627 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-02  5:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-30 17:42 [PATCH 1/1] [SCSI] bfa: use ARRAY_SIZE instead of sizeof/sizeof[0] Fabian Frederick
2014-07-02  5:16 ` Anil Gurumurthy
2014-07-02  5:16   ` Anil Gurumurthy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.