diff options
author | Paul Mackerras <paulus@samba.org> | 2006-09-19 14:06:27 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-09-20 15:09:48 +1000 |
commit | a4dc7ff08915a2035aa6d6decc53fa1deaa410bb (patch) | |
tree | 9b28af3a21f915e3fe8ed7ee163be1b1d2bfe8b0 /arch/powerpc/kernel/prom.c | |
parent | 19e59df4dc2e6f7b46190ee77ce7093769f597a7 (diff) | |
download | kernel-crypto-a4dc7ff08915a2035aa6d6decc53fa1deaa410bb.tar.gz kernel-crypto-a4dc7ff08915a2035aa6d6decc53fa1deaa410bb.tar.xz kernel-crypto-a4dc7ff08915a2035aa6d6decc53fa1deaa410bb.zip |
[POWERPC] Define of_read_ulong helper
There are various places where we want to extract an unsigned long
value from a device-tree property that can be 1 or 2 cells in length.
This replaces some open-coded calculations, and one place where we
assumed without checking that properties were the length we wanted,
with a little of_read_ulong() helper.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/prom.c')
-rw-r--r-- | arch/powerpc/kernel/prom.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index bf2005b2feb..eb913f80bfb 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c @@ -757,24 +757,9 @@ static int __init early_init_dt_scan_root(unsigned long node, static unsigned long __init dt_mem_next_cell(int s, cell_t **cellp) { cell_t *p = *cellp; - unsigned long r; - /* Ignore more than 2 cells */ - while (s > sizeof(unsigned long) / 4) { - p++; - s--; - } - r = *p++; -#ifdef CONFIG_PPC64 - if (s > 1) { - r <<= 32; - r |= *(p++); - s--; - } -#endif - - *cellp = p; - return r; + *cellp = p + s; + return of_read_ulong(p, s); } |