]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[PATCH] V850: user ARRAY_SIZE macro when appropriate
authorAhmed S. Darwish <darwish.07@gmail.com>
Sat, 10 Feb 2007 09:44:30 +0000 (01:44 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 11 Feb 2007 18:51:24 +0000 (10:51 -0800)
Use ARRAY_SIZE macro already defined in linux/kernel.h

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
Cc: Miles Bader <uclinux-v850@lsi.nec.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/v850/kernel/anna.c
arch/v850/kernel/as85ep1.c
arch/v850/kernel/fpga85e2c.c
arch/v850/kernel/gbus_int.c
arch/v850/kernel/ma.c
arch/v850/kernel/me2.c
arch/v850/kernel/rte_cb.c
arch/v850/kernel/rte_mb_a_pci.c
arch/v850/kernel/rte_me2_cb.c
arch/v850/kernel/teg.c

index 40892d3e3c247ea2dbada930d4f65b5675f05993..0e429041a117606aa39674aa3d367ac684910a92 100644 (file)
@@ -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];
 
index 5352f8a5aa070191f9d0d027a0ac7bc420b10cb9..18437bc5c3ad29aa53eb221d0a1595aa7445aac2 100644 (file)
@@ -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];
 
index cb04a6954ccbc5d99b639d119bc36a50fa6f96ca..5c4923558a75c8f7b5620ccb7a5fb3f20df60f3a 100644 (file)
@@ -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];
 
index 25d636e79e6acfe59be1fc933632ad894e880a21..b2bcc251f65b8b1ec3c6c9a0d63845c25d99af69 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/signal.h>
+#include <linux/kernel.h>
 
 #include <asm/machdep.h>
 
@@ -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).  */
@@ -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];
 
index 2aa8ab0f7edcb4f1198ae67205b9f815fdb6beaa..143774de75e1a590ca83a82018f10706bfa09be5 100644 (file)
@@ -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];
 
index 14b0c8858aa46a8445dc44ee8f566316b0b04fbb..38be5c194f6b9a5ca782a2b71f07e66f60e0e7e3 100644 (file)
@@ -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];
 
index 0f7f6cd705a2d1eae01fa817054e462a577ef917..43018e1edebd13b6bf84558ef32628c13056c0af 100644 (file)
@@ -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>
@@ -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];
 
index 35213fa9f7d829544c36e1223a6805df9cc4f004..35a4bd5515cb53c8903d612fc43ebda0a4cb5535 100644 (file)
@@ -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)
 
 \f
 /* PCI configuration primitives.  */
index 3be355a029e27766c21f823661b435a524d06277..46803d48dffe2e5a14aec1c12813e8b6598f2465 100644 (file)
@@ -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;
index 290d506650166633a691aecd1c953cfeff75cd16..699248f92aae104d2a9091384a1798b5bfd73a42 100644 (file)
@@ -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];