Skip to contentSkip to conversation

drivers/ide/legacy/hd.c: Array size

PATCH New Andi Drebes 1 participant 1 message Jun 5, 2007 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/ide/legacy/hd.c: Array size

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.

---

drivers/ide/legacy/hd.c +1 -1
index 45ed035..661c12f 100644
@@ -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
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors