Skip to content

Commit

Permalink
[PATCH] V850: user ARRAY_SIZE macro when appropriate
Browse files Browse the repository at this point in the history
Use ARRAY_SIZE macro already defined in linux/kernel.h

Signed-off-by: Ahmed S. Darwish <[email protected]>
Cc: Miles Bader <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
a-darwish authored and Linus Torvalds committed Feb 11, 2007
1 parent 6e6d74c commit 81d79be
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion arch/v850/kernel/anna.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static struct v850e_intc_irq_init irq_inits[] = {
{ "ST", IRQ_INTST(0), IRQ_INTST_NUM, 3, 5 },
{ 0 }
};
#define NUM_IRQ_INITS ((sizeof irq_inits / sizeof irq_inits[0]) - 1)
#define NUM_IRQ_INITS (ARRAY_SIZE(irq_inits) - 1)

static struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS];

Expand Down
2 changes: 1 addition & 1 deletion arch/v850/kernel/as85ep1.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static struct v850e_intc_irq_init irq_inits[] = {
{ "ST", IRQ_INTST(0), IRQ_INTST_NUM, 3, 5 },
{ 0 }
};
#define NUM_IRQ_INITS ((sizeof irq_inits / sizeof irq_inits[0]) - 1)
#define NUM_IRQ_INITS (ARRAY_SIZE(irq_inits) - 1)

static struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS];

Expand Down
2 changes: 1 addition & 1 deletion arch/v850/kernel/fpga85e2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ struct v850e_intc_irq_init irq_inits[] = {
{ "RPU", IRQ_RPU(0), IRQ_RPU_NUM, 1, 6 },
{ 0 }
};
#define NUM_IRQ_INITS ((sizeof irq_inits / sizeof irq_inits[0]) - 1)
#define NUM_IRQ_INITS (ARRAY_SIZE(irq_inits) - 1)

struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS];

Expand Down
6 changes: 3 additions & 3 deletions arch/v850/kernel/gbus_int.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/signal.h>
#include <linux/kernel.h>

#include <asm/machdep.h>

Expand All @@ -36,7 +37,7 @@ struct used_gint {
{ 1, GBUS_INT_PRIORITY_HIGH },
{ 3, GBUS_INT_PRIORITY_LOW }
};
#define NUM_USED_GINTS (sizeof used_gint / sizeof used_gint[0])
#define NUM_USED_GINTS ARRAY_SIZE(used_gint)

/* A table of which GINT is used by each GBUS interrupts (they are
assigned based on priority). */
Expand Down Expand Up @@ -231,8 +232,7 @@ struct gbus_int_irq_init gbus_irq_inits[] __initdata = {
{ "GBUS_INT", IRQ_GBUS_INT(0), IRQ_GBUS_INT_NUM, 1, 6},
{ 0 }
};
#define NUM_GBUS_IRQ_INITS \
((sizeof gbus_irq_inits / sizeof gbus_irq_inits[0]) - 1)
#define NUM_GBUS_IRQ_INITS (ARRAY_SIZE(gbus_irq_inits) - 1)

static struct hw_interrupt_type gbus_hw_itypes[NUM_GBUS_IRQ_INITS];

Expand Down
2 changes: 1 addition & 1 deletion arch/v850/kernel/ma.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static struct v850e_intc_irq_init irq_inits[] = {
{ "ST", IRQ_INTST(0), IRQ_INTST_NUM, 4, 5 },
{ 0 }
};
#define NUM_IRQ_INITS ((sizeof irq_inits / sizeof irq_inits[0]) - 1)
#define NUM_IRQ_INITS (ARRAY_SIZE(irq_inits) - 1)

static struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS];

Expand Down
2 changes: 1 addition & 1 deletion arch/v850/kernel/me2.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static struct v850e_intc_irq_init irq_inits[] = {
{ "UBTITO", IRQ_INTUBTITO(0), IRQ_INTUBTITO_NUM, 5, 4 },
{ 0 }
};
#define NUM_IRQ_INITS ((sizeof irq_inits / sizeof irq_inits[0]) - 1)
#define NUM_IRQ_INITS (ARRAY_SIZE(irq_inits) - 1)

static struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS];

Expand Down
4 changes: 2 additions & 2 deletions arch/v850/kernel/rte_cb.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/irq.h>
#include <linux/fs.h>
#include <linux/module.h>
#include <linux/kernel.h>

#include <asm/machdep.h>
#include <asm/v850e_uart.h>
Expand Down Expand Up @@ -176,8 +177,7 @@ static struct gbus_int_irq_init gbus_irq_inits[] = {
#endif
{ 0 }
};
#define NUM_GBUS_IRQ_INITS \
((sizeof gbus_irq_inits / sizeof gbus_irq_inits[0]) - 1)
#define NUM_GBUS_IRQ_INITS (ARRAY_SIZE(gbus_irq_inits) - 1)

static struct hw_interrupt_type gbus_hw_itypes[NUM_GBUS_IRQ_INITS];

Expand Down
3 changes: 1 addition & 2 deletions arch/v850/kernel/rte_mb_a_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ static struct mb_pci_dev_irq mb_pci_dev_irqs[] = {
/* PCI slot 2 */
{ 9, IRQ_MB_A_PCI2(0), 1 }
};
#define NUM_MB_PCI_DEV_IRQS \
(sizeof mb_pci_dev_irqs / sizeof mb_pci_dev_irqs[0])
#define NUM_MB_PCI_DEV_IRQS ARRAY_SIZE(mb_pci_dev_irqs)


/* PCI configuration primitives. */
Expand Down
3 changes: 1 addition & 2 deletions arch/v850/kernel/rte_me2_cb.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ static struct cb_pic_irq_init cb_pic_irq_inits[] = {
{ "CB_EXTTM2", IRQ_CB_EXTTM2, 1, 1, 6 },
{ 0 }
};
#define NUM_CB_PIC_IRQ_INITS \
((sizeof cb_pic_irq_inits / sizeof cb_pic_irq_inits[0]) - 1)
#define NUM_CB_PIC_IRQ_INITS (ARRAY_SIZE(cb_pic_irq_inits) - 1)

static struct hw_interrupt_type cb_pic_hw_itypes[NUM_CB_PIC_IRQ_INITS];
static unsigned char cb_pic_active_irqs = 0;
Expand Down
2 changes: 1 addition & 1 deletion arch/v850/kernel/teg.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static struct v850e_intc_irq_init irq_inits[] = {
{ "ST", IRQ_INTST(0), IRQ_INTST_NUM, 1, 5 },
{ 0 }
};
#define NUM_IRQ_INITS ((sizeof irq_inits / sizeof irq_inits[0]) - 1)
#define NUM_IRQ_INITS (ARRAY_SIZE(irq_inits) - 1)

static struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS];

Expand Down

0 comments on commit 81d79be

Please sign in to comment.