Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[MIPS] Converting most array size calculations to use ARRAY_SIZE().

Signed-off-by: Alejandro Martinez Ruiz <alex@flawedcode.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Alejandro Martinez Ruiz and committed by
Ralf Baechle
2b22c034 161548bf

+4 -5
+1 -1
arch/mips/au1000/common/dbdma.c
··· 179 179 { 0, 0, 0, 0, 0, 0, 0 }, 180 180 }; 181 181 182 - #define DBDEV_TAB_SIZE (sizeof(dbdev_tab) / sizeof(dbdev_tab_t)) 182 + #define DBDEV_TAB_SIZE ARRAY_SIZE(dbdev_tab) 183 183 184 184 static chan_tab_t *chan_tab_ptr[NUM_DBDMA_CHANS]; 185 185
+1 -2
arch/mips/kernel/kspd.c
··· 161 161 int i; 162 162 unsigned int ret = 0; 163 163 164 - for (i = 0; i < (sizeof(open_flags_table) / sizeof(struct apsp_table)); 165 - i++) { 164 + for (i = 0; i < ARRAY_SIZE(open_flags_table); i++) { 166 165 if( (flags & open_flags_table[i].sp) ) { 167 166 ret |= open_flags_table[i].ap; 168 167 }
+1 -1
arch/mips/philips/pnx8550/common/setup.c
··· 74 74 }, 75 75 }; 76 76 77 - #define STANDARD_IO_RESOURCES (sizeof(standard_io_resources)/sizeof(struct resource)) 77 + #define STANDARD_IO_RESOURCES ARRAY_SIZE(standard_io_resources) 78 78 79 79 extern struct resource pci_io_resource; 80 80 extern struct resource pci_mem_resource;
+1 -1
arch/mips/vr41xx/nec-cmbvr4133/setup.c
··· 50 50 } 51 51 }; 52 52 53 - #define number_partitions (sizeof(cmbvr4133_mtd_parts)/sizeof(struct mtd_partition)) 53 + #define number_partitions ARRAY_SIZE(cmbvr4133_mtd_parts) 54 54 #endif 55 55 56 56 extern void i8259_init(void);