Skip to contentSkip to conversation

drivers/atm/nicstarmac.c: Array size calculations

PATCH New Andi Drebes 1 participant 1 message May 26, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/atm/nicstarmac.c: Array size calculations

This patch replaces a line in drivers/atm/nicstarmac.c that caluclates the size of an array with the ARRAY_SIZE(x) macro.

---
Compile tested with allyesconfig on i386.
Diffed against Linus' git-tree

drivers/atm/nicstarmac.c +1 -1
index 480947f..842e26c 100644
@@ -134,7 +134,7 @@ nicstar_read_eprom_status( virt_addr_t base )
    /* Send read instruction */
    val = NICSTAR_REG_READ( base, NICSTAR_REG_GENERAL_PURPOSE ) & 0xFFFFFFF0;
 
-   for (i=0; i<sizeof rdsrtab/sizeof rdsrtab[0]; i++)
+   for (i=0; i<ARRAY_SIZE(rdsrtab); i++)
    {
 	NICSTAR_REG_WRITE( base, NICSTAR_REG_GENERAL_PURPOSE,
 		(val | rdsrtab[i]) );

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors