aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/numa.c
diff options
context:
space:
mode:
authorGreg Kurz <gkurz@linux.vnet.ibm.com>2015-02-23 16:14:25 +0100
committerMichael Ellerman <mpe@ellerman.id.au>2015-03-18 10:48:59 +1100
commitb1fc9484aa339c19bd57702dc88fb046702b6092 (patch)
tree5a860891e5e0a9f7883e6c5a4126d8508e7b2aee /arch/powerpc/mm/numa.c
parent9d0e6d9db56a38e205e7138837b885082dc769ec (diff)
downloadlinux-b1fc9484aa339c19bd57702dc88fb046702b6092.tar.gz
powerpc/vphn: move endianness fixing to vphn_unpack_associativity()
The first argument to vphn_unpack_associativity() is a const long *, but the parsing code expects __be64 values actually. Let's move the endian fixing down for consistency. Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/numa.c')
-rw-r--r--arch/powerpc/mm/numa.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 7a5bc21152f6d..59196c5a0984b 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1263,13 +1263,18 @@ static int update_cpu_associativity_changes_mask(void)
*/
static int vphn_unpack_associativity(const long *packed, __be32 *unpacked)
{
+ __be64 be_packed[VPHN_REGISTER_COUNT];
int i, nr_assoc_doms = 0;
- const __be16 *field = (const __be16 *) packed;
+ const __be16 *field = (const __be16 *) be_packed;
#define VPHN_FIELD_UNUSED (0xffff)
#define VPHN_FIELD_MSB (0x8000)
#define VPHN_FIELD_MASK (~VPHN_FIELD_MSB)
+ /* Let's recreate the original stream. */
+ for (i = 0; i < VPHN_REGISTER_COUNT; i++)
+ be_packed[i] = cpu_to_be64(packed[i]);
+
for (i = 1; i < VPHN_ASSOC_BUFSIZE; i++) {
if (be16_to_cpup(field) == VPHN_FIELD_UNUSED) {
/* All significant fields processed, and remaining
@@ -1310,11 +1315,8 @@ static long hcall_vphn(unsigned long cpu, __be32 *associativity)
long retbuf[PLPAR_HCALL9_BUFSIZE] = {0};
u64 flags = 1;
int hwcpu = get_hard_smp_processor_id(cpu);
- int i;
rc = plpar_hcall9(H_HOME_NODE_ASSOCIATIVITY, retbuf, flags, hwcpu);
- for (i = 0; i < VPHN_REGISTER_COUNT; i++)
- retbuf[i] = cpu_to_be64(retbuf[i]);
vphn_unpack_associativity(retbuf, associativity);
return rc;