drivers/eisa/eisa-bus.c: Array size calculation using
PATCH 1/1 drivers/eisa/eisa-bus.c: Array size calculation using
This patch replaces an array size calculation in drivers/eisa/eisa-bus.c that was done using sizeof with the ARRAY_SIZE macro. I also removed the preprocessor definition "EISA_INFOS" that represented the number of entries in eisa_table because it was only referenced once.
Tested by compilation on an i386 box using "allyesconfig". Diffed against Linus' git-tree.
Signed-off-by Andi Drebes <[email protected]>
---
drivers/eisa/eisa-bus.c +1 -2
@@ -29,7 +29,6 @@ struct eisa_device_info {static struct eisa_device_info __initdata eisa_table[] = { #include "devlist.h" }; -#define EISA_INFOS (sizeof (eisa_table) / (sizeof (struct eisa_device_info)))#endif #define EISA_MAX_FORCED_DEV 16
@@ -59,7 +58,7 @@ static void __init eisa_name_device (struct eisa_device *edev) { #ifdef CONFIG_EISA_NAMES int i; - for (i = 0; i < EISA_INFOS; i++) { + for (i = 0; i < ARRAY_SIZE(eisa_table); i++) { if (!strcmp (edev->id.sig, eisa_table[i].id.sig)) { strlcpy (edev->pretty_name, eisa_table[i].name,
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors