提交 84c1a13a 编写于 作者: T Tobias Klauser 提交者: David S. Miller

[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: NTobias Klauser <tklauser@nuerscht.ch>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 940fdc6e
...@@ -43,7 +43,7 @@ struct cpu_fp_info linux_sparc_fpu[] = { ...@@ -43,7 +43,7 @@ struct cpu_fp_info linux_sparc_fpu[] = {
{ 0x3e, 0x22, 0, "UltraSparc IIIi+ integrated FPU"}, { 0x3e, 0x22, 0, "UltraSparc IIIi+ integrated FPU"},
}; };
#define NSPARCFPU (sizeof(linux_sparc_fpu)/sizeof(struct cpu_fp_info)) #define NSPARCFPU ARRAY_SIZE(linux_sparc_fpu)
struct cpu_iu_info linux_sparc_chips[] = { struct cpu_iu_info linux_sparc_chips[] = {
{ 0x17, 0x10, "TI UltraSparc I (SpitFire)"}, { 0x17, 0x10, "TI UltraSparc I (SpitFire)"},
...@@ -59,7 +59,7 @@ struct cpu_iu_info linux_sparc_chips[] = { ...@@ -59,7 +59,7 @@ struct cpu_iu_info linux_sparc_chips[] = {
{ 0x3e, 0x22, "TI UltraSparc IIIi+ (Serrano)"}, { 0x3e, 0x22, "TI UltraSparc IIIi+ (Serrano)"},
}; };
#define NSPARCCHIPS (sizeof(linux_sparc_chips)/sizeof(struct cpu_iu_info)) #define NSPARCCHIPS ARRAY_SIZE(linux_sparc_chips)
char *sparc_cpu_type = "cpu-oops"; char *sparc_cpu_type = "cpu-oops";
char *sparc_fpu_type = "fpu-oops"; char *sparc_fpu_type = "fpu-oops";
......
...@@ -790,7 +790,7 @@ static unsigned long sysio_irq_offsets[] = { ...@@ -790,7 +790,7 @@ static unsigned long sysio_irq_offsets[] = {
#undef bogon #undef bogon
#define NUM_SYSIO_OFFSETS (sizeof(sysio_irq_offsets) / sizeof(sysio_irq_offsets[0])) #define NUM_SYSIO_OFFSETS ARRAY_SIZE(sysio_irq_offsets)
/* Convert Interrupt Mapping register pointer to associated /* Convert Interrupt Mapping register pointer to associated
* Interrupt Clear register pointer, SYSIO specific version. * Interrupt Clear register pointer, SYSIO specific version.
......
...@@ -30,8 +30,6 @@ ...@@ -30,8 +30,6 @@
#include <asm/sections.h> #include <asm/sections.h>
#include <asm/kdebug.h> #include <asm/kdebug.h>
#define ELEMENTS(arr) (sizeof (arr)/sizeof (arr[0]))
/* /*
* To debug kernel to catch accesses to certain virtual/physical addresses. * To debug kernel to catch accesses to certain virtual/physical addresses.
* Mode = 0 selects physical watchpoints, mode = 1 selects virtual watchpoints. * Mode = 0 selects physical watchpoints, mode = 1 selects virtual watchpoints.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册