diff options
author | Tobias Klauser <tklauser@nuerscht.ch> | 2005-11-07 03:58:31 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 10:53:28 -0500 |
commit | 38e548ee1a79c8da7b3d9e26f2adce9b61413f84 (patch) | |
tree | 1811dc06acbba9d9bccebe6ad3fc495e96862e60 /arch/i386 | |
parent | 0d6d82b6712c808e461090dd483f111f72b3b38b (diff) |
[PATCH] arch/i386: Use ARRAY_SIZE macro
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0])
Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386')
-rw-r--r-- | arch/i386/kernel/apm.c | 5 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/mca.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/reboot_fixups.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/smpboot.c | 2 |
5 files changed, 6 insertions, 7 deletions
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c index d2ef0c2aa93e..86e80c551478 100644 --- a/arch/i386/kernel/apm.c +++ b/arch/i386/kernel/apm.c | |||
@@ -447,8 +447,7 @@ static char * apm_event_name[] = { | |||
447 | "system standby resume", | 447 | "system standby resume", |
448 | "capabilities change" | 448 | "capabilities change" |
449 | }; | 449 | }; |
450 | #define NR_APM_EVENT_NAME \ | 450 | #define NR_APM_EVENT_NAME ARRAY_SIZE(apm_event_name) |
451 | (sizeof(apm_event_name) / sizeof(apm_event_name[0])) | ||
452 | 451 | ||
453 | typedef struct lookup_t { | 452 | typedef struct lookup_t { |
454 | int key; | 453 | int key; |
@@ -479,7 +478,7 @@ static const lookup_t error_table[] = { | |||
479 | { APM_NO_ERROR, "BIOS did not set a return code" }, | 478 | { APM_NO_ERROR, "BIOS did not set a return code" }, |
480 | { APM_NOT_PRESENT, "No APM present" } | 479 | { APM_NOT_PRESENT, "No APM present" } |
481 | }; | 480 | }; |
482 | #define ERROR_COUNT (sizeof(error_table)/sizeof(lookup_t)) | 481 | #define ERROR_COUNT ARRAY_SIZE(error_table) |
483 | 482 | ||
484 | /** | 483 | /** |
485 | * apm_error - display an APM error | 484 | * apm_error - display an APM error |
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c index 1465974256c9..0ea010a7afb1 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c +++ b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c | |||
@@ -67,7 +67,7 @@ static const struct cpu_id cpu_ids[] = { | |||
67 | [CPU_MP4HT_D0] = {15, 3, 4 }, | 67 | [CPU_MP4HT_D0] = {15, 3, 4 }, |
68 | [CPU_MP4HT_E0] = {15, 4, 1 }, | 68 | [CPU_MP4HT_E0] = {15, 4, 1 }, |
69 | }; | 69 | }; |
70 | #define N_IDS (sizeof(cpu_ids)/sizeof(cpu_ids[0])) | 70 | #define N_IDS ARRAY_SIZE(cpu_ids) |
71 | 71 | ||
72 | struct cpu_model | 72 | struct cpu_model |
73 | { | 73 | { |
diff --git a/arch/i386/kernel/mca.c b/arch/i386/kernel/mca.c index 8600faeea29d..558bb207720f 100644 --- a/arch/i386/kernel/mca.c +++ b/arch/i386/kernel/mca.c | |||
@@ -132,7 +132,7 @@ static struct resource mca_standard_resources[] = { | |||
132 | { .start = 0x100, .end = 0x107, .name = "POS (MCA)" } | 132 | { .start = 0x100, .end = 0x107, .name = "POS (MCA)" } |
133 | }; | 133 | }; |
134 | 134 | ||
135 | #define MCA_STANDARD_RESOURCES (sizeof(mca_standard_resources)/sizeof(struct resource)) | 135 | #define MCA_STANDARD_RESOURCES ARRAY_SIZE(mca_standard_resources) |
136 | 136 | ||
137 | /** | 137 | /** |
138 | * mca_read_and_store_pos - read the POS registers into a memory buffer | 138 | * mca_read_and_store_pos - read the POS registers into a memory buffer |
diff --git a/arch/i386/kernel/reboot_fixups.c b/arch/i386/kernel/reboot_fixups.c index c9b87330aeea..6f73c9ea4e3d 100644 --- a/arch/i386/kernel/reboot_fixups.c +++ b/arch/i386/kernel/reboot_fixups.c | |||
@@ -42,7 +42,7 @@ void mach_reboot_fixups(void) | |||
42 | struct pci_dev *dev; | 42 | struct pci_dev *dev; |
43 | int i; | 43 | int i; |
44 | 44 | ||
45 | for (i=0; i < (sizeof(fixups_table)/sizeof(fixups_table[0])); i++) { | 45 | for (i=0; i < ARRAY_SIZE(fixups_table); i++) { |
46 | cur = &(fixups_table[i]); | 46 | cur = &(fixups_table[i]); |
47 | dev = pci_get_device(cur->vendor, cur->device, NULL); | 47 | dev = pci_get_device(cur->vendor, cur->device, NULL); |
48 | if (!dev) | 48 | if (!dev) |
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c index 01b618e73ecd..e6488ffc1f79 100644 --- a/arch/i386/kernel/smpboot.c +++ b/arch/i386/kernel/smpboot.c | |||
@@ -612,7 +612,7 @@ static inline void __inquire_remote_apic(int apicid) | |||
612 | 612 | ||
613 | printk("Inquiring remote APIC #%d...\n", apicid); | 613 | printk("Inquiring remote APIC #%d...\n", apicid); |
614 | 614 | ||
615 | for (i = 0; i < sizeof(regs) / sizeof(*regs); i++) { | 615 | for (i = 0; i < ARRAY_SIZE(regs); i++) { |
616 | printk("... APIC #%d %s: ", apicid, names[i]); | 616 | printk("... APIC #%d %s: ", apicid, names[i]); |
617 | 617 | ||
618 | /* | 618 | /* |