diff options
author | malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-12-22 20:33:55 +0000 |
---|---|---|
committer | malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-12-22 20:33:55 +0000 |
commit | b1503cda1e78cad4dca522ddbb4c69f4c6869bcd (patch) | |
tree | 26edd30543fcb27ae90f8762558ea878df42ec57 /hw/sh_intc.c | |
parent | 5626b017d623cb88d973b53bca11613c766b1715 (diff) |
Use the ARRAY_SIZE() macro where appropriate.
Change from v1:
Avoid changing the existing coding style in certain files.
Signed-off-by: Stuart Brady <stuart.brady@gmail.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6120 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/sh_intc.c')
-rw-r--r-- | hw/sh_intc.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/hw/sh_intc.c b/hw/sh_intc.c index 136e7dd216..9039e555d5 100644 --- a/hw/sh_intc.c +++ b/hw/sh_intc.c @@ -17,7 +17,6 @@ //#define DEBUG_INTC_SOURCES #define INTC_A7(x) ((x) & 0x1fffffff) -#define INTC_ARRAY(x) (sizeof(x) / sizeof(x[0])) void sh_intc_toggle_source(struct intc_source *source, int enable_adj, int assert_adj) @@ -327,7 +326,7 @@ static void sh_intc_register_source(struct intc_desc *desc, for (i = 0; i < desc->nr_mask_regs; i++) { struct intc_mask_reg *mr = desc->mask_regs + i; - for (k = 0; k < INTC_ARRAY(mr->enum_ids); k++) { + for (k = 0; k < ARRAY_SIZE(mr->enum_ids); k++) { if (mr->enum_ids[k] != source) continue; @@ -342,7 +341,7 @@ static void sh_intc_register_source(struct intc_desc *desc, for (i = 0; i < desc->nr_prio_regs; i++) { struct intc_prio_reg *pr = desc->prio_regs + i; - for (k = 0; k < INTC_ARRAY(pr->enum_ids); k++) { + for (k = 0; k < ARRAY_SIZE(pr->enum_ids); k++) { if (pr->enum_ids[k] != source) continue; @@ -357,7 +356,7 @@ static void sh_intc_register_source(struct intc_desc *desc, for (i = 0; i < nr_groups; i++) { struct intc_group *gr = groups + i; - for (k = 0; k < INTC_ARRAY(gr->enum_ids); k++) { + for (k = 0; k < ARRAY_SIZE(gr->enum_ids); k++) { if (gr->enum_ids[k] != source) continue; @@ -400,7 +399,7 @@ void sh_intc_register_sources(struct intc_desc *desc, s = sh_intc_source(desc, gr->enum_id); s->next_enum_id = gr->enum_ids[0]; - for (k = 1; k < INTC_ARRAY(gr->enum_ids); k++) { + for (k = 1; k < ARRAY_SIZE(gr->enum_ids); k++) { if (!gr->enum_ids[k]) continue; |