diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2006-09-29 19:47:55 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-09-29 19:47:55 -0400 |
commit | b9629b82c81709eb0f9c98b8f9cc684f8e212ef3 (patch) | |
tree | d5423026f42f0881b38c2793a6bfcf3bd61d2cea /arch/i386/kernel/setup.c | |
parent | 29cbc78b90a73ad80f2f58ba2927956cf663abed (diff) |
[PATCH] i386: replace intermediate array-size definitions with ARRAY_SIZE()
Code is easier to validate if array sizes aren't hidden behind extra
#defines.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/i386/kernel/setup.c')
-rw-r--r-- | arch/i386/kernel/setup.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index 814cdebf7377..000cf03751fe 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c | |||
@@ -209,9 +209,6 @@ static struct resource adapter_rom_resources[] = { { | |||
209 | .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM | 209 | .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM |
210 | } }; | 210 | } }; |
211 | 211 | ||
212 | #define ADAPTER_ROM_RESOURCES \ | ||
213 | (sizeof adapter_rom_resources / sizeof adapter_rom_resources[0]) | ||
214 | |||
215 | static struct resource video_rom_resource = { | 212 | static struct resource video_rom_resource = { |
216 | .name = "Video ROM", | 213 | .name = "Video ROM", |
217 | .start = 0xc0000, | 214 | .start = 0xc0000, |
@@ -273,9 +270,6 @@ static struct resource standard_io_resources[] = { { | |||
273 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | 270 | .flags = IORESOURCE_BUSY | IORESOURCE_IO |
274 | } }; | 271 | } }; |
275 | 272 | ||
276 | #define STANDARD_IO_RESOURCES \ | ||
277 | (sizeof standard_io_resources / sizeof standard_io_resources[0]) | ||
278 | |||
279 | #define romsignature(x) (*(unsigned short *)(x) == 0xaa55) | 273 | #define romsignature(x) (*(unsigned short *)(x) == 0xaa55) |
280 | 274 | ||
281 | static int __init romchecksum(unsigned char *rom, unsigned long length) | 275 | static int __init romchecksum(unsigned char *rom, unsigned long length) |
@@ -332,7 +326,7 @@ static void __init probe_roms(void) | |||
332 | } | 326 | } |
333 | 327 | ||
334 | /* check for adapter roms on 2k boundaries */ | 328 | /* check for adapter roms on 2k boundaries */ |
335 | for (i = 0; i < ADAPTER_ROM_RESOURCES && start < upper; start += 2048) { | 329 | for (i = 0; i < ARRAY_SIZE(adapter_rom_resources) && start < upper; start += 2048) { |
336 | rom = isa_bus_to_virt(start); | 330 | rom = isa_bus_to_virt(start); |
337 | if (!romsignature(rom)) | 331 | if (!romsignature(rom)) |
338 | continue; | 332 | continue; |
@@ -1272,7 +1266,7 @@ static int __init request_standard_resources(void) | |||
1272 | request_resource(&iomem_resource, &video_ram_resource); | 1266 | request_resource(&iomem_resource, &video_ram_resource); |
1273 | 1267 | ||
1274 | /* request I/O space for devices used on all i[345]86 PCs */ | 1268 | /* request I/O space for devices used on all i[345]86 PCs */ |
1275 | for (i = 0; i < STANDARD_IO_RESOURCES; i++) | 1269 | for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++) |
1276 | request_resource(&ioport_resource, &standard_io_resources[i]); | 1270 | request_resource(&ioport_resource, &standard_io_resources[i]); |
1277 | return 0; | 1271 | return 0; |
1278 | } | 1272 | } |