All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] [trivial] drivers/ide/legacy/hd.c: Array size
@ 2007-06-05  9:37 Andi Drebes
  0 siblings, 0 replies; only message in thread
From: Andi Drebes @ 2007-06-05  9:37 UTC (permalink / raw)
  To: kernel-janitors

This patch replaces an array size calculation in drivers/ide/legacy/hd.c
that was done using sizeof with the ARRAY_SIZE macro.

Tested by compilation on an i386 box using "allyesconfig".
Diffed against Linus' git-tree.

Signed-off-by: Andi Drebes <lists-receive@programmierforen.de>
---
diff --git a/drivers/ide/legacy/hd.c b/drivers/ide/legacy/hd.c
index 45ed035..661c12f 100644
--- a/drivers/ide/legacy/hd.c
+++ b/drivers/ide/legacy/hd.c
@@ -130,7 +130,7 @@ struct hd_i_struct {
 	
 #ifdef HD_TYPE
 static struct hd_i_struct hd_info[] = { HD_TYPE };
-static int NR_HD = ((sizeof (hd_info))/(sizeof (struct hd_i_struct)));
+static int NR_HD = ARRAY_SIZE(hd_info);
 #else
 static struct hd_i_struct hd_info[MAX_HD];
 static int NR_HD;
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-06-05  9:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-05  9:37 [KJ] [PATCH] [trivial] drivers/ide/legacy/hd.c: Array size Andi Drebes

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.