aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@nuerscht.ch>2005-11-09 15:03:42 -0500
committerDavid S. Miller <davem@davemloft.net>2005-11-09 15:03:42 -0500
commit84c1a13a30f21406f39e546684a78ebe9859e6d7 (patch)
tree296330a7d501eb349070363df28da70b10a62963 /arch/sparc64
parent940fdc6e1223f1323b88b7f1e7ae09a93a76b74d (diff)
[SPARC64]: 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/sparc64')
-rw-r--r--arch/sparc64/kernel/cpu.c4
-rw-r--r--arch/sparc64/kernel/sbus.c2
-rw-r--r--arch/sparc64/mm/fault.c2
3 files changed, 3 insertions, 5 deletions
diff --git a/arch/sparc64/kernel/cpu.c b/arch/sparc64/kernel/cpu.c
index 77ef5df4e5a7..00eed88ef2e8 100644
--- a/arch/sparc64/kernel/cpu.c
+++ b/arch/sparc64/kernel/cpu.c
@@ -43,7 +43,7 @@ struct cpu_fp_info linux_sparc_fpu[] = {
43 { 0x3e, 0x22, 0, "UltraSparc IIIi+ integrated FPU"}, 43 { 0x3e, 0x22, 0, "UltraSparc IIIi+ integrated FPU"},
44}; 44};
45 45
46#define NSPARCFPU (sizeof(linux_sparc_fpu)/sizeof(struct cpu_fp_info)) 46#define NSPARCFPU ARRAY_SIZE(linux_sparc_fpu)
47 47
48struct cpu_iu_info linux_sparc_chips[] = { 48struct cpu_iu_info linux_sparc_chips[] = {
49 { 0x17, 0x10, "TI UltraSparc I (SpitFire)"}, 49 { 0x17, 0x10, "TI UltraSparc I (SpitFire)"},
@@ -59,7 +59,7 @@ struct cpu_iu_info linux_sparc_chips[] = {
59 { 0x3e, 0x22, "TI UltraSparc IIIi+ (Serrano)"}, 59 { 0x3e, 0x22, "TI UltraSparc IIIi+ (Serrano)"},
60}; 60};
61 61
62#define NSPARCCHIPS (sizeof(linux_sparc_chips)/sizeof(struct cpu_iu_info)) 62#define NSPARCCHIPS ARRAY_SIZE(linux_sparc_chips)
63 63
64char *sparc_cpu_type = "cpu-oops"; 64char *sparc_cpu_type = "cpu-oops";
65char *sparc_fpu_type = "fpu-oops"; 65char *sparc_fpu_type = "fpu-oops";
diff --git a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c
index e09ddf927655..96b825055668 100644
--- a/arch/sparc64/kernel/sbus.c
+++ b/arch/sparc64/kernel/sbus.c
@@ -790,7 +790,7 @@ static unsigned long sysio_irq_offsets[] = {
790 790
791#undef bogon 791#undef bogon
792 792
793#define NUM_SYSIO_OFFSETS (sizeof(sysio_irq_offsets) / sizeof(sysio_irq_offsets[0])) 793#define NUM_SYSIO_OFFSETS ARRAY_SIZE(sysio_irq_offsets)
794 794
795/* Convert Interrupt Mapping register pointer to associated 795/* Convert Interrupt Mapping register pointer to associated
796 * Interrupt Clear register pointer, SYSIO specific version. 796 * Interrupt Clear register pointer, SYSIO specific version.
diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c
index 3be278d916db..6f0539aa44d0 100644
--- a/arch/sparc64/mm/fault.c
+++ b/arch/sparc64/mm/fault.c
@@ -30,8 +30,6 @@
30#include <asm/sections.h> 30#include <asm/sections.h>
31#include <asm/kdebug.h> 31#include <asm/kdebug.h>
32 32
33#define ELEMENTS(arr) (sizeof (arr)/sizeof (arr[0]))
34
35/* 33/*
36 * To debug kernel to catch accesses to certain virtual/physical addresses. 34 * To debug kernel to catch accesses to certain virtual/physical addresses.
37 * Mode = 0 selects physical watchpoints, mode = 1 selects virtual watchpoints. 35 * Mode = 0 selects physical watchpoints, mode = 1 selects virtual watchpoints.