diff options
author | Ahmed S. Darwish <darwish.07@gmail.com> | 2007-02-10 04:44:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-11 13:51:24 -0500 |
commit | 81d79bec348ab06cba9ae9fc03eb015b6b83703a (patch) | |
tree | 2a2d17b93cbbf18f66726037621838eb0897a166 /arch | |
parent | 6e6d74cfac782a3a4cb5111bd9c25cd95d6b7c6c (diff) |
[PATCH] V850: user ARRAY_SIZE macro when appropriate
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/v850/kernel/anna.c | 2 | ||||
-rw-r--r-- | arch/v850/kernel/as85ep1.c | 2 | ||||
-rw-r--r-- | arch/v850/kernel/fpga85e2c.c | 2 | ||||
-rw-r--r-- | arch/v850/kernel/gbus_int.c | 6 | ||||
-rw-r--r-- | arch/v850/kernel/ma.c | 2 | ||||
-rw-r--r-- | arch/v850/kernel/me2.c | 2 | ||||
-rw-r--r-- | arch/v850/kernel/rte_cb.c | 4 | ||||
-rw-r--r-- | arch/v850/kernel/rte_mb_a_pci.c | 3 | ||||
-rw-r--r-- | arch/v850/kernel/rte_me2_cb.c | 3 | ||||
-rw-r--r-- | arch/v850/kernel/teg.c | 2 |
10 files changed, 13 insertions, 15 deletions
diff --git a/arch/v850/kernel/anna.c b/arch/v850/kernel/anna.c index 40892d3e3c24..0e429041a117 100644 --- a/arch/v850/kernel/anna.c +++ b/arch/v850/kernel/anna.c | |||
@@ -114,7 +114,7 @@ static struct v850e_intc_irq_init irq_inits[] = { | |||
114 | { "ST", IRQ_INTST(0), IRQ_INTST_NUM, 3, 5 }, | 114 | { "ST", IRQ_INTST(0), IRQ_INTST_NUM, 3, 5 }, |
115 | { 0 } | 115 | { 0 } |
116 | }; | 116 | }; |
117 | #define NUM_IRQ_INITS ((sizeof irq_inits / sizeof irq_inits[0]) - 1) | 117 | #define NUM_IRQ_INITS (ARRAY_SIZE(irq_inits) - 1) |
118 | 118 | ||
119 | static struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS]; | 119 | static struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS]; |
120 | 120 | ||
diff --git a/arch/v850/kernel/as85ep1.c b/arch/v850/kernel/as85ep1.c index 5352f8a5aa07..18437bc5c3ad 100644 --- a/arch/v850/kernel/as85ep1.c +++ b/arch/v850/kernel/as85ep1.c | |||
@@ -142,7 +142,7 @@ static struct v850e_intc_irq_init irq_inits[] = { | |||
142 | { "ST", IRQ_INTST(0), IRQ_INTST_NUM, 3, 5 }, | 142 | { "ST", IRQ_INTST(0), IRQ_INTST_NUM, 3, 5 }, |
143 | { 0 } | 143 | { 0 } |
144 | }; | 144 | }; |
145 | #define NUM_IRQ_INITS ((sizeof irq_inits / sizeof irq_inits[0]) - 1) | 145 | #define NUM_IRQ_INITS (ARRAY_SIZE(irq_inits) - 1) |
146 | 146 | ||
147 | static struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS]; | 147 | static struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS]; |
148 | 148 | ||
diff --git a/arch/v850/kernel/fpga85e2c.c b/arch/v850/kernel/fpga85e2c.c index cb04a6954ccb..5c4923558a75 100644 --- a/arch/v850/kernel/fpga85e2c.c +++ b/arch/v850/kernel/fpga85e2c.c | |||
@@ -138,7 +138,7 @@ struct v850e_intc_irq_init irq_inits[] = { | |||
138 | { "RPU", IRQ_RPU(0), IRQ_RPU_NUM, 1, 6 }, | 138 | { "RPU", IRQ_RPU(0), IRQ_RPU_NUM, 1, 6 }, |
139 | { 0 } | 139 | { 0 } |
140 | }; | 140 | }; |
141 | #define NUM_IRQ_INITS ((sizeof irq_inits / sizeof irq_inits[0]) - 1) | 141 | #define NUM_IRQ_INITS (ARRAY_SIZE(irq_inits) - 1) |
142 | 142 | ||
143 | struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS]; | 143 | struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS]; |
144 | 144 | ||
diff --git a/arch/v850/kernel/gbus_int.c b/arch/v850/kernel/gbus_int.c index 25d636e79e6a..b2bcc251f65b 100644 --- a/arch/v850/kernel/gbus_int.c +++ b/arch/v850/kernel/gbus_int.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/irq.h> | 16 | #include <linux/irq.h> |
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/signal.h> | 18 | #include <linux/signal.h> |
19 | #include <linux/kernel.h> | ||
19 | 20 | ||
20 | #include <asm/machdep.h> | 21 | #include <asm/machdep.h> |
21 | 22 | ||
@@ -36,7 +37,7 @@ struct used_gint { | |||
36 | { 1, GBUS_INT_PRIORITY_HIGH }, | 37 | { 1, GBUS_INT_PRIORITY_HIGH }, |
37 | { 3, GBUS_INT_PRIORITY_LOW } | 38 | { 3, GBUS_INT_PRIORITY_LOW } |
38 | }; | 39 | }; |
39 | #define NUM_USED_GINTS (sizeof used_gint / sizeof used_gint[0]) | 40 | #define NUM_USED_GINTS ARRAY_SIZE(used_gint) |
40 | 41 | ||
41 | /* A table of which GINT is used by each GBUS interrupts (they are | 42 | /* A table of which GINT is used by each GBUS interrupts (they are |
42 | assigned based on priority). */ | 43 | assigned based on priority). */ |
@@ -231,8 +232,7 @@ struct gbus_int_irq_init gbus_irq_inits[] __initdata = { | |||
231 | { "GBUS_INT", IRQ_GBUS_INT(0), IRQ_GBUS_INT_NUM, 1, 6}, | 232 | { "GBUS_INT", IRQ_GBUS_INT(0), IRQ_GBUS_INT_NUM, 1, 6}, |
232 | { 0 } | 233 | { 0 } |
233 | }; | 234 | }; |
234 | #define NUM_GBUS_IRQ_INITS \ | 235 | #define NUM_GBUS_IRQ_INITS (ARRAY_SIZE(gbus_irq_inits) - 1) |
235 | ((sizeof gbus_irq_inits / sizeof gbus_irq_inits[0]) - 1) | ||
236 | 236 | ||
237 | static struct hw_interrupt_type gbus_hw_itypes[NUM_GBUS_IRQ_INITS]; | 237 | static struct hw_interrupt_type gbus_hw_itypes[NUM_GBUS_IRQ_INITS]; |
238 | 238 | ||
diff --git a/arch/v850/kernel/ma.c b/arch/v850/kernel/ma.c index 2aa8ab0f7edc..143774de75e1 100644 --- a/arch/v850/kernel/ma.c +++ b/arch/v850/kernel/ma.c | |||
@@ -43,7 +43,7 @@ static struct v850e_intc_irq_init irq_inits[] = { | |||
43 | { "ST", IRQ_INTST(0), IRQ_INTST_NUM, 4, 5 }, | 43 | { "ST", IRQ_INTST(0), IRQ_INTST_NUM, 4, 5 }, |
44 | { 0 } | 44 | { 0 } |
45 | }; | 45 | }; |
46 | #define NUM_IRQ_INITS ((sizeof irq_inits / sizeof irq_inits[0]) - 1) | 46 | #define NUM_IRQ_INITS (ARRAY_SIZE(irq_inits) - 1) |
47 | 47 | ||
48 | static struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS]; | 48 | static struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS]; |
49 | 49 | ||
diff --git a/arch/v850/kernel/me2.c b/arch/v850/kernel/me2.c index 14b0c8858aa4..38be5c194f6b 100644 --- a/arch/v850/kernel/me2.c +++ b/arch/v850/kernel/me2.c | |||
@@ -44,7 +44,7 @@ static struct v850e_intc_irq_init irq_inits[] = { | |||
44 | { "UBTITO", IRQ_INTUBTITO(0), IRQ_INTUBTITO_NUM, 5, 4 }, | 44 | { "UBTITO", IRQ_INTUBTITO(0), IRQ_INTUBTITO_NUM, 5, 4 }, |
45 | { 0 } | 45 | { 0 } |
46 | }; | 46 | }; |
47 | #define NUM_IRQ_INITS ((sizeof irq_inits / sizeof irq_inits[0]) - 1) | 47 | #define NUM_IRQ_INITS (ARRAY_SIZE(irq_inits) - 1) |
48 | 48 | ||
49 | static struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS]; | 49 | static struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS]; |
50 | 50 | ||
diff --git a/arch/v850/kernel/rte_cb.c b/arch/v850/kernel/rte_cb.c index 0f7f6cd705a2..43018e1edebd 100644 --- a/arch/v850/kernel/rte_cb.c +++ b/arch/v850/kernel/rte_cb.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/irq.h> | 15 | #include <linux/irq.h> |
16 | #include <linux/fs.h> | 16 | #include <linux/fs.h> |
17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
18 | #include <linux/kernel.h> | ||
18 | 19 | ||
19 | #include <asm/machdep.h> | 20 | #include <asm/machdep.h> |
20 | #include <asm/v850e_uart.h> | 21 | #include <asm/v850e_uart.h> |
@@ -176,8 +177,7 @@ static struct gbus_int_irq_init gbus_irq_inits[] = { | |||
176 | #endif | 177 | #endif |
177 | { 0 } | 178 | { 0 } |
178 | }; | 179 | }; |
179 | #define NUM_GBUS_IRQ_INITS \ | 180 | #define NUM_GBUS_IRQ_INITS (ARRAY_SIZE(gbus_irq_inits) - 1) |
180 | ((sizeof gbus_irq_inits / sizeof gbus_irq_inits[0]) - 1) | ||
181 | 181 | ||
182 | static struct hw_interrupt_type gbus_hw_itypes[NUM_GBUS_IRQ_INITS]; | 182 | static struct hw_interrupt_type gbus_hw_itypes[NUM_GBUS_IRQ_INITS]; |
183 | 183 | ||
diff --git a/arch/v850/kernel/rte_mb_a_pci.c b/arch/v850/kernel/rte_mb_a_pci.c index 35213fa9f7d8..35a4bd5515cb 100644 --- a/arch/v850/kernel/rte_mb_a_pci.c +++ b/arch/v850/kernel/rte_mb_a_pci.c | |||
@@ -70,8 +70,7 @@ static struct mb_pci_dev_irq mb_pci_dev_irqs[] = { | |||
70 | /* PCI slot 2 */ | 70 | /* PCI slot 2 */ |
71 | { 9, IRQ_MB_A_PCI2(0), 1 } | 71 | { 9, IRQ_MB_A_PCI2(0), 1 } |
72 | }; | 72 | }; |
73 | #define NUM_MB_PCI_DEV_IRQS \ | 73 | #define NUM_MB_PCI_DEV_IRQS ARRAY_SIZE(mb_pci_dev_irqs) |
74 | (sizeof mb_pci_dev_irqs / sizeof mb_pci_dev_irqs[0]) | ||
75 | 74 | ||
76 | 75 | ||
77 | /* PCI configuration primitives. */ | 76 | /* PCI configuration primitives. */ |
diff --git a/arch/v850/kernel/rte_me2_cb.c b/arch/v850/kernel/rte_me2_cb.c index 3be355a029e2..46803d48dffe 100644 --- a/arch/v850/kernel/rte_me2_cb.c +++ b/arch/v850/kernel/rte_me2_cb.c | |||
@@ -170,8 +170,7 @@ static struct cb_pic_irq_init cb_pic_irq_inits[] = { | |||
170 | { "CB_EXTTM2", IRQ_CB_EXTTM2, 1, 1, 6 }, | 170 | { "CB_EXTTM2", IRQ_CB_EXTTM2, 1, 1, 6 }, |
171 | { 0 } | 171 | { 0 } |
172 | }; | 172 | }; |
173 | #define NUM_CB_PIC_IRQ_INITS \ | 173 | #define NUM_CB_PIC_IRQ_INITS (ARRAY_SIZE(cb_pic_irq_inits) - 1) |
174 | ((sizeof cb_pic_irq_inits / sizeof cb_pic_irq_inits[0]) - 1) | ||
175 | 174 | ||
176 | static struct hw_interrupt_type cb_pic_hw_itypes[NUM_CB_PIC_IRQ_INITS]; | 175 | static struct hw_interrupt_type cb_pic_hw_itypes[NUM_CB_PIC_IRQ_INITS]; |
177 | static unsigned char cb_pic_active_irqs = 0; | 176 | static unsigned char cb_pic_active_irqs = 0; |
diff --git a/arch/v850/kernel/teg.c b/arch/v850/kernel/teg.c index 290d50665016..699248f92aae 100644 --- a/arch/v850/kernel/teg.c +++ b/arch/v850/kernel/teg.c | |||
@@ -43,7 +43,7 @@ static struct v850e_intc_irq_init irq_inits[] = { | |||
43 | { "ST", IRQ_INTST(0), IRQ_INTST_NUM, 1, 5 }, | 43 | { "ST", IRQ_INTST(0), IRQ_INTST_NUM, 1, 5 }, |
44 | { 0 } | 44 | { 0 } |
45 | }; | 45 | }; |
46 | #define NUM_IRQ_INITS ((sizeof irq_inits / sizeof irq_inits[0]) - 1) | 46 | #define NUM_IRQ_INITS (ARRAY_SIZE(irq_inits) - 1) |
47 | 47 | ||
48 | static struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS]; | 48 | static struct hw_interrupt_type hw_itypes[NUM_IRQ_INITS]; |
49 | 49 | ||