Skip to content

Commit

Permalink
[SPARC]: Use ARRAY_SIZE macro
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tobias Klauser authored and David S. Miller committed Nov 9, 2005
1 parent a5ee363 commit 940fdc6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions arch/sparc/kernel/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ struct cpu_fp_info linux_sparc_fpu[] = {
{ 9, 3, "Fujitsu or Weitek on-chip 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[] = {
/* Sun4/100, 4/200, SLC */
Expand Down Expand Up @@ -120,7 +120,7 @@ struct cpu_iu_info linux_sparc_chips[] = {
{ 0xf, 0, "UNKNOWN CPU-VENDOR/TYPE"},
};

#define NSPARCCHIPS (sizeof(linux_sparc_chips)/sizeof(struct cpu_iu_info))
#define NSPARCCHIPS ARRAY_SIZE(linux_sparc_chips)

char *sparc_cpu_type;
char *sparc_fpu_type;
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/pcic.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ static struct pcic_ca2irq pcic_i_jk[] = {
* as several PROMs may be installed on the same physical board.
*/
#define SN2L_INIT(name, map) \
{ name, map, sizeof(map)/sizeof(struct pcic_ca2irq) }
{ name, map, ARRAY_SIZE(map) }

static struct pcic_sn2list pcic_known_sysnames[] = {
SN2L_INIT("SUNW,JavaEngine1", pcic_i_je1a), /* JE1, PROM 2.32 */
Expand Down
2 changes: 0 additions & 2 deletions arch/sparc/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
#include <asm/kdebug.h>
#include <asm/uaccess.h>

#define ELEMENTS(arr) (sizeof (arr)/sizeof (arr[0]))

extern int prom_node_root;

/* At boot time we determine these two values necessary for setting
Expand Down

0 comments on commit 940fdc6

Please sign in to comment.