From 25c8716cb08dea386c7d6220b82eba732ccbf976 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 30 Jul 2006 03:03:23 -0700 Subject: [PATCH] arch/alpha: Use ARRAY_SIZE macro Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove a duplicate of the macro. Also remove some trailing whitespaces and needless braces. Signed-off-by: Tobias Klauser Cc: Richard Henderson Cc: Ivan Kokshaysky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/alpha/kernel/sys_ruffian.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'arch/alpha/kernel/sys_ruffian.c') diff --git a/arch/alpha/kernel/sys_ruffian.c b/arch/alpha/kernel/sys_ruffian.c index 78c30decf3ff..5b99cf3cd69c 100644 --- a/arch/alpha/kernel/sys_ruffian.c +++ b/arch/alpha/kernel/sys_ruffian.c @@ -182,16 +182,16 @@ static unsigned long __init ruffian_get_bank_size(unsigned long offset) { unsigned long bank_addr, bank, ret = 0; - + /* Valid offsets are: 0x800, 0x840 and 0x880 since Ruffian only uses three banks. */ bank_addr = (unsigned long)PYXIS_MCR + offset; bank = *(vulp)bank_addr; - + /* Check BANK_ENABLE */ if (bank & 0x01) { static unsigned long size[] __initdata = { - 0x40000000UL, /* 0x00, 1G */ + 0x40000000UL, /* 0x00, 1G */ 0x20000000UL, /* 0x02, 512M */ 0x10000000UL, /* 0x04, 256M */ 0x08000000UL, /* 0x06, 128M */ @@ -203,7 +203,7 @@ ruffian_get_bank_size(unsigned long offset) }; bank = (bank & 0x1e) >> 1; - if (bank < sizeof(size)/sizeof(*size)) + if (bank < ARRAY_SIZE(size)) ret = size[bank]; } -- cgit