提交 2b22c034 编写于 作者: A Alejandro Martinez Ruiz 提交者: Ralf Baechle

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

Signed-off-by: NAlejandro Martinez Ruiz <alex@flawedcode.org>
Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 161548bf
...@@ -179,7 +179,7 @@ static dbdev_tab_t dbdev_tab[] = { ...@@ -179,7 +179,7 @@ static dbdev_tab_t dbdev_tab[] = {
{ 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0 },
}; };
#define DBDEV_TAB_SIZE (sizeof(dbdev_tab) / sizeof(dbdev_tab_t)) #define DBDEV_TAB_SIZE ARRAY_SIZE(dbdev_tab)
static chan_tab_t *chan_tab_ptr[NUM_DBDMA_CHANS]; static chan_tab_t *chan_tab_ptr[NUM_DBDMA_CHANS];
......
...@@ -161,8 +161,7 @@ static unsigned int translate_open_flags(int flags) ...@@ -161,8 +161,7 @@ static unsigned int translate_open_flags(int flags)
int i; int i;
unsigned int ret = 0; unsigned int ret = 0;
for (i = 0; i < (sizeof(open_flags_table) / sizeof(struct apsp_table)); for (i = 0; i < ARRAY_SIZE(open_flags_table); i++) {
i++) {
if( (flags & open_flags_table[i].sp) ) { if( (flags & open_flags_table[i].sp) ) {
ret |= open_flags_table[i].ap; ret |= open_flags_table[i].ap;
} }
......
...@@ -74,7 +74,7 @@ struct resource standard_io_resources[] = { ...@@ -74,7 +74,7 @@ struct resource standard_io_resources[] = {
}, },
}; };
#define STANDARD_IO_RESOURCES (sizeof(standard_io_resources)/sizeof(struct resource)) #define STANDARD_IO_RESOURCES ARRAY_SIZE(standard_io_resources)
extern struct resource pci_io_resource; extern struct resource pci_io_resource;
extern struct resource pci_mem_resource; extern struct resource pci_mem_resource;
......
...@@ -50,7 +50,7 @@ static struct mtd_partition cmbvr4133_mtd_parts[] = { ...@@ -50,7 +50,7 @@ static struct mtd_partition cmbvr4133_mtd_parts[] = {
} }
}; };
#define number_partitions (sizeof(cmbvr4133_mtd_parts)/sizeof(struct mtd_partition)) #define number_partitions ARRAY_SIZE(cmbvr4133_mtd_parts)
#endif #endif
extern void i8259_init(void); extern void i8259_init(void);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册