diff options
author | Alex Unleashed <alex@flawedcode.org> | 2007-11-14 20:01:06 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-14 21:45:46 -0500 |
commit | 16ad1b49104684da3ab0fede79f29b01f4c76896 (patch) | |
tree | 941aa34bbe00df34f619526e198d9d6e0124f45c /arch/cris/arch-v32/kernel | |
parent | f150f35232daaedd86e46d2581e3b7eb40e2c360 (diff) |
cris: ARRAY_SIZE() cleanup
I'm converting most array size calculations under arch/ to use
ARRAY_SIZE(). This is the patch for CRIS.
Signed-off-by: Alejandro Martinez Ruiz <alex@flawedcode.org>
Cc: Mikael Starvik <starvik@axis.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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 dfbfcb8d2585..a22a9e02e093 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[] = | |||
49 | } | 49 | } |
50 | }; | 50 | }; |
51 | 51 | ||
52 | #define NBR_OF_PORTS sizeof(crisv32_ioports)/sizeof(struct crisv32_ioport) | 52 | #define NBR_OF_PORTS ARRAY_SIZE(crisv32_ioports) |
53 | 53 | ||
54 | struct crisv32_iopin crisv32_led1_green; | 54 | struct crisv32_iopin crisv32_led1_green; |
55 | struct crisv32_iopin crisv32_led1_red; | 55 | 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 4662f363df63..72e9e8331f63 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) | |||
54 | { | 54 | { |
55 | int i; | 55 | int i; |
56 | int cpu = (int)v - 1; | 56 | int cpu = (int)v - 1; |
57 | int entries; | ||
58 | unsigned long revision; | 57 | unsigned long revision; |
59 | struct cpu_info *info; | 58 | struct cpu_info *info; |
60 | 59 | ||
61 | entries = sizeof cpinfo / sizeof(struct cpu_info); | 60 | info = &cpinfo[ARRAY_SIZE(cpinfo) - 1]; |
62 | info = &cpinfo[entries - 1]; | ||
63 | 61 | ||
64 | #ifdef CONFIG_SMP | 62 | #ifdef CONFIG_SMP |
65 | if (!cpu_online(cpu)) | 63 | if (!cpu_online(cpu)) |
@@ -68,7 +66,7 @@ show_cpuinfo(struct seq_file *m, void *v) | |||
68 | 66 | ||
69 | revision = rdvr(); | 67 | revision = rdvr(); |
70 | 68 | ||
71 | for (i = 0; i < entries; i++) { | 69 | for (i = 0; i < ARRAY_SIZE(cpinfo); i++) { |
72 | if (cpinfo[i].rev == revision) { | 70 | if (cpinfo[i].rev == revision) { |
73 | info = &cpinfo[i]; | 71 | info = &cpinfo[i]; |
74 | break; | 72 | break; |