summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/setup_64.c
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2013-08-07 02:01:30 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-08-14 15:33:21 +1000
commit7946d5a513e510269d6e0126597f8667c886d0d7 (patch)
tree8892125dbec1ea4ed870eded4701f134d5b93660 /arch/powerpc/kernel/setup_64.c
parent08bc1dc51ffdaa453990a4cc300f1acf897d7817 (diff)
downloadblackbird-op-linux-7946d5a513e510269d6e0126597f8667c886d0d7.tar.gz
blackbird-op-linux-7946d5a513e510269d6e0126597f8667c886d0d7.zip
powerpc: Make cache info device tree accesses endian safe
Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/setup_64.c')
-rw-r--r--arch/powerpc/kernel/setup_64.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 9d5bae118d7e..45f2d1fac670 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -320,14 +320,14 @@ static void __init initialize_cache_info(void)
* d-cache and i-cache sizes... -Peter
*/
if (num_cpus == 1) {
- const u32 *sizep, *lsizep;
+ const __be32 *sizep, *lsizep;
u32 size, lsize;
size = 0;
lsize = cur_cpu_spec->dcache_bsize;
sizep = of_get_property(np, "d-cache-size", NULL);
if (sizep != NULL)
- size = *sizep;
+ size = be32_to_cpu(*sizep);
lsizep = of_get_property(np, "d-cache-block-size",
NULL);
/* fallback if block size missing */
@@ -336,7 +336,7 @@ static void __init initialize_cache_info(void)
"d-cache-line-size",
NULL);
if (lsizep != NULL)
- lsize = *lsizep;
+ lsize = be32_to_cpu(*lsizep);
if (sizep == NULL || lsizep == NULL)
DBG("Argh, can't find dcache properties ! "
"sizep: %p, lsizep: %p\n", sizep, lsizep);
@@ -350,7 +350,7 @@ static void __init initialize_cache_info(void)
lsize = cur_cpu_spec->icache_bsize;
sizep = of_get_property(np, "i-cache-size", NULL);
if (sizep != NULL)
- size = *sizep;
+ size = be32_to_cpu(*sizep);
lsizep = of_get_property(np, "i-cache-block-size",
NULL);
if (lsizep == NULL)
@@ -358,7 +358,7 @@ static void __init initialize_cache_info(void)
"i-cache-line-size",
NULL);
if (lsizep != NULL)
- lsize = *lsizep;
+ lsize = be32_to_cpu(*lsizep);
if (sizep == NULL || lsizep == NULL)
DBG("Argh, can't find icache properties ! "
"sizep: %p, lsizep: %p\n", sizep, lsizep);
OpenPOWER on IntegriCloud