diff options
Diffstat (limited to 'arch/cris/arch-v32/kernel')
-rw-r--r-- | arch/cris/arch-v32/kernel/io.c | 2 | ||||
-rw-r--r-- | arch/cris/arch-v32/kernel/setup.c | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/arch/cris/arch-v32/kernel/io.c b/arch/cris/arch-v32/kernel/io.c index dfbfcb8d258..a22a9e02e09 100644 --- a/arch/cris/arch-v32/kernel/io.c +++ b/arch/cris/arch-v32/kernel/io.c @@ -49,7 +49,7 @@ struct crisv32_ioport crisv32_ioports[] = } }; -#define NBR_OF_PORTS sizeof(crisv32_ioports)/sizeof(struct crisv32_ioport) +#define NBR_OF_PORTS ARRAY_SIZE(crisv32_ioports) struct crisv32_iopin crisv32_led1_green; struct crisv32_iopin crisv32_led1_red; diff --git a/arch/cris/arch-v32/kernel/setup.c b/arch/cris/arch-v32/kernel/setup.c index 4662f363df6..72e9e8331f6 100644 --- a/arch/cris/arch-v32/kernel/setup.c +++ b/arch/cris/arch-v32/kernel/setup.c @@ -54,12 +54,10 @@ show_cpuinfo(struct seq_file *m, void *v) { int i; int cpu = (int)v - 1; - int entries; unsigned long revision; struct cpu_info *info; - entries = sizeof cpinfo / sizeof(struct cpu_info); - info = &cpinfo[entries - 1]; + info = &cpinfo[ARRAY_SIZE(cpinfo) - 1]; #ifdef CONFIG_SMP if (!cpu_online(cpu)) @@ -68,7 +66,7 @@ show_cpuinfo(struct seq_file *m, void *v) revision = rdvr(); - for (i = 0; i < entries; i++) { + for (i = 0; i < ARRAY_SIZE(cpinfo); i++) { if (cpinfo[i].rev == revision) { info = &cpinfo[i]; break; |