linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: bfa: use ARRAY_SIZE for array sizing calculation on array __pciids
@ 2018-01-07 23:15 Colin King
  2018-01-10 21:51 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2018-01-07 23:15 UTC (permalink / raw)
  To: Anil Gurumurthy, Sudarsana Kalluru, James E . J . Bottomley,
	Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Use the ARRAY_SIZE macro on array __pciids to determine size of the array.
Improvement suggested by coccinelle.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/bfa/bfa_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/bfa/bfa_core.c b/drivers/scsi/bfa/bfa_core.c
index 3e1caec82554..10a63be92544 100644
--- a/drivers/scsi/bfa/bfa_core.c
+++ b/drivers/scsi/bfa/bfa_core.c
@@ -1957,7 +1957,7 @@ bfa_get_pciids(struct bfa_pciid_s **pciids, int *npciids)
 		{BFA_PCI_VENDOR_ID_BROCADE, BFA_PCI_DEVICE_ID_CT_FC},
 	};
 
-	*npciids = sizeof(__pciids) / sizeof(__pciids[0]);
+	*npciids = ARRAY_SIZE(__pciids);
 	*pciids = __pciids;
 }
 
-- 
2.15.1

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

* Re: [PATCH] scsi: bfa: use ARRAY_SIZE for array sizing calculation on array __pciids
  2018-01-07 23:15 [PATCH] scsi: bfa: use ARRAY_SIZE for array sizing calculation on array __pciids Colin King
@ 2018-01-10 21:51 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2018-01-10 21:51 UTC (permalink / raw)
  To: Colin King
  Cc: Anil Gurumurthy, Sudarsana Kalluru, James E . J . Bottomley,
	Martin K . Petersen, linux-scsi, kernel-janitors, linux-kernel


Colin,

> Use the ARRAY_SIZE macro on array __pciids to determine size of the array.
> Improvement suggested by coccinelle.

Applied to 4.16/scsi-queue. Thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2018-01-10 21:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-07 23:15 [PATCH] scsi: bfa: use ARRAY_SIZE for array sizing calculation on array __pciids Colin King
2018-01-10 21:51 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).