aboutsummaryrefslogtreecommitdiff
path: root/target-ppc/translate_init.c
diff options
context:
space:
mode:
authormalc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-22 20:33:55 +0000
committermalc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-22 20:33:55 +0000
commitb1503cda1e78cad4dca522ddbb4c69f4c6869bcd (patch)
tree26edd30543fcb27ae90f8762558ea878df42ec57 /target-ppc/translate_init.c
parent5626b017d623cb88d973b53bca11613c766b1715 (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 'target-ppc/translate_init.c')
-rw-r--r--target-ppc/translate_init.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 0ce81ed738..3f01e66f68 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -9455,7 +9455,7 @@ static const ppc_def_t *ppc_find_by_pvr (uint32_t pvr)
int i, best, match, best_match, max;
ret = NULL;
- max = sizeof(ppc_defs) / sizeof(ppc_def_t);
+ max = ARRAY_SIZE(ppc_defs);
best = -1;
pvr_rev = pvr & 0xFFFF;
/* We want all specified bits to match */
@@ -9510,7 +9510,7 @@ const ppc_def_t *cpu_ppc_find_by_name (const char *name)
return ppc_find_by_pvr(strtoul(name, NULL, 16));
}
ret = NULL;
- max = sizeof(ppc_defs) / sizeof(ppc_def_t);
+ max = ARRAY_SIZE(ppc_defs);
for (i = 0; i < max; i++) {
if (strcasecmp(name, ppc_defs[i].name) == 0) {
ret = &ppc_defs[i];
@@ -9525,7 +9525,7 @@ void ppc_cpu_list (FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...))
{
int i, max;
- max = sizeof(ppc_defs) / sizeof(ppc_def_t);
+ max = ARRAY_SIZE(ppc_defs);
for (i = 0; i < max; i++) {
(*cpu_fprintf)(f, "PowerPC %-16s PVR %08x\n",
ppc_defs[i].name, ppc_defs[i].pvr);