Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/pseries/hvcserver: Fix endian issue in hvcs_get_partner_info

A buffer returned by H_VTERM_PARTNER_INFO contains device information
in big endian format, causing problems for little endian architectures.
This patch ensures that they are in cpu endian.

Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Thomas Falcon and committed by
Benjamin Herrenschmidt
587870e8 a71d64b4

+2 -2
+2 -2
arch/powerpc/platforms/pseries/hvcserver.c
··· 163 163 return retval; 164 164 } 165 165 166 - last_p_partition_ID = pi_buff[0]; 167 - last_p_unit_address = pi_buff[1]; 166 + last_p_partition_ID = be64_to_cpu(pi_buff[0]); 167 + last_p_unit_address = be64_to_cpu(pi_buff[1]); 168 168 169 169 /* This indicates that there are no further partners */ 170 170 if (last_p_partition_ID == ~0UL