diff options
author | Tobias Klauser <tklauser@nuerscht.ch> | 2005-11-09 15:03:05 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-11-09 15:03:05 -0500 |
commit | 940fdc6e1223f1323b88b7f1e7ae09a93a76b74d (patch) | |
tree | 5a4ea9eb953dedae6bc0b7828a63133f16a5902a /arch/sparc | |
parent | a5ee3634630c218e86afc5bae2acb55b9e47625d (diff) |
[SPARC]: Use ARRAY_SIZE macro
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove a
duplicate of ARRAY_SIZE which is never used anyways.
Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/kernel/cpu.c | 4 | ||||
-rw-r--r-- | arch/sparc/kernel/pcic.c | 2 | ||||
-rw-r--r-- | arch/sparc/mm/fault.c | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c index 6a4ebc62193e..d7bfc61d2879 100644 --- a/arch/sparc/kernel/cpu.c +++ b/arch/sparc/kernel/cpu.c | |||
@@ -75,7 +75,7 @@ struct cpu_fp_info linux_sparc_fpu[] = { | |||
75 | { 9, 3, "Fujitsu or Weitek on-chip FPU"}, | 75 | { 9, 3, "Fujitsu or Weitek on-chip FPU"}, |
76 | }; | 76 | }; |
77 | 77 | ||
78 | #define NSPARCFPU (sizeof(linux_sparc_fpu)/sizeof(struct cpu_fp_info)) | 78 | #define NSPARCFPU ARRAY_SIZE(linux_sparc_fpu) |
79 | 79 | ||
80 | struct cpu_iu_info linux_sparc_chips[] = { | 80 | struct cpu_iu_info linux_sparc_chips[] = { |
81 | /* Sun4/100, 4/200, SLC */ | 81 | /* Sun4/100, 4/200, SLC */ |
@@ -120,7 +120,7 @@ struct cpu_iu_info linux_sparc_chips[] = { | |||
120 | { 0xf, 0, "UNKNOWN CPU-VENDOR/TYPE"}, | 120 | { 0xf, 0, "UNKNOWN CPU-VENDOR/TYPE"}, |
121 | }; | 121 | }; |
122 | 122 | ||
123 | #define NSPARCCHIPS (sizeof(linux_sparc_chips)/sizeof(struct cpu_iu_info)) | 123 | #define NSPARCCHIPS ARRAY_SIZE(linux_sparc_chips) |
124 | 124 | ||
125 | char *sparc_cpu_type; | 125 | char *sparc_cpu_type; |
126 | char *sparc_fpu_type; | 126 | char *sparc_fpu_type; |
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c index 25e31d5ec99b..cccfc12802ed 100644 --- a/arch/sparc/kernel/pcic.c +++ b/arch/sparc/kernel/pcic.c | |||
@@ -143,7 +143,7 @@ static struct pcic_ca2irq pcic_i_jk[] = { | |||
143 | * as several PROMs may be installed on the same physical board. | 143 | * as several PROMs may be installed on the same physical board. |
144 | */ | 144 | */ |
145 | #define SN2L_INIT(name, map) \ | 145 | #define SN2L_INIT(name, map) \ |
146 | { name, map, sizeof(map)/sizeof(struct pcic_ca2irq) } | 146 | { name, map, ARRAY_SIZE(map) } |
147 | 147 | ||
148 | static struct pcic_sn2list pcic_known_sysnames[] = { | 148 | static struct pcic_sn2list pcic_known_sysnames[] = { |
149 | SN2L_INIT("SUNW,JavaEngine1", pcic_i_je1a), /* JE1, PROM 2.32 */ | 149 | SN2L_INIT("SUNW,JavaEngine1", pcic_i_je1a), /* JE1, PROM 2.32 */ |
diff --git a/arch/sparc/mm/fault.c b/arch/sparc/mm/fault.c index 2bbd53f3cafb..9eeed3347df3 100644 --- a/arch/sparc/mm/fault.c +++ b/arch/sparc/mm/fault.c | |||
@@ -33,8 +33,6 @@ | |||
33 | #include <asm/kdebug.h> | 33 | #include <asm/kdebug.h> |
34 | #include <asm/uaccess.h> | 34 | #include <asm/uaccess.h> |
35 | 35 | ||
36 | #define ELEMENTS(arr) (sizeof (arr)/sizeof (arr[0])) | ||
37 | |||
38 | extern int prom_node_root; | 36 | extern int prom_node_root; |
39 | 37 | ||
40 | /* At boot time we determine these two values necessary for setting | 38 | /* At boot time we determine these two values necessary for setting |