diff options
author | Andi Kleen <ak@suse.de> | 2006-09-29 19:47:55 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-09-29 19:47:55 -0400 |
commit | 9d0ef4fd61693acd3741ab7ee544246cda1f8738 (patch) | |
tree | a52103681f1d7ad1ab9ee68d1fc31a0e6b0c34ca /arch/x86_64 | |
parent | b9629b82c81709eb0f9c98b8f9cc684f8e212ef3 (diff) |
[PATCH] Use ARRAY_SIZE in setup.c
Based on i386 patch from Bjorn.
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/kernel/setup.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c index 0b00bb2ea576..fc944b5e8f4a 100644 --- a/arch/x86_64/kernel/setup.c +++ b/arch/x86_64/kernel/setup.c | |||
@@ -123,9 +123,6 @@ struct resource standard_io_resources[] = { | |||
123 | .flags = IORESOURCE_BUSY | IORESOURCE_IO } | 123 | .flags = IORESOURCE_BUSY | IORESOURCE_IO } |
124 | }; | 124 | }; |
125 | 125 | ||
126 | #define STANDARD_IO_RESOURCES \ | ||
127 | (sizeof standard_io_resources / sizeof standard_io_resources[0]) | ||
128 | |||
129 | #define IORESOURCE_RAM (IORESOURCE_BUSY | IORESOURCE_MEM) | 126 | #define IORESOURCE_RAM (IORESOURCE_BUSY | IORESOURCE_MEM) |
130 | 127 | ||
131 | struct resource data_resource = { | 128 | struct resource data_resource = { |
@@ -172,9 +169,6 @@ static struct resource adapter_rom_resources[] = { | |||
172 | .flags = IORESOURCE_ROM } | 169 | .flags = IORESOURCE_ROM } |
173 | }; | 170 | }; |
174 | 171 | ||
175 | #define ADAPTER_ROM_RESOURCES \ | ||
176 | (sizeof adapter_rom_resources / sizeof adapter_rom_resources[0]) | ||
177 | |||
178 | static struct resource video_rom_resource = { | 172 | static struct resource video_rom_resource = { |
179 | .name = "Video ROM", | 173 | .name = "Video ROM", |
180 | .start = 0xc0000, | 174 | .start = 0xc0000, |
@@ -245,7 +239,8 @@ static void __init probe_roms(void) | |||
245 | } | 239 | } |
246 | 240 | ||
247 | /* check for adapter roms on 2k boundaries */ | 241 | /* check for adapter roms on 2k boundaries */ |
248 | for (i = 0; i < ADAPTER_ROM_RESOURCES && start < upper; start += 2048) { | 242 | for (i = 0; i < ARRAY_SIZE(adapter_rom_resources) && start < upper; |
243 | start += 2048) { | ||
249 | rom = isa_bus_to_virt(start); | 244 | rom = isa_bus_to_virt(start); |
250 | if (!romsignature(rom)) | 245 | if (!romsignature(rom)) |
251 | continue; | 246 | continue; |
@@ -537,7 +532,7 @@ void __init setup_arch(char **cmdline_p) | |||
537 | { | 532 | { |
538 | unsigned i; | 533 | unsigned i; |
539 | /* request I/O space for devices used on all i[345]86 PCs */ | 534 | /* request I/O space for devices used on all i[345]86 PCs */ |
540 | for (i = 0; i < STANDARD_IO_RESOURCES; i++) | 535 | for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++) |
541 | request_resource(&ioport_resource, &standard_io_resources[i]); | 536 | request_resource(&ioport_resource, &standard_io_resources[i]); |
542 | } | 537 | } |
543 | 538 | ||