powerpc/pseries/hvcserver: Fix endian issue in hvcs_get_partner_info
authorThomas Falcon <tlfalcon@linux.vnet.ibm.com>
Tue, 5 Aug 2014 21:42:39 +0000 (16:42 -0500)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 13 Aug 2014 05:14:04 +0000 (15:14 +1000)
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>
arch/powerpc/platforms/pseries/hvcserver.c

index 4557e91..eedb645 100644 (file)
@@ -163,8 +163,8 @@ int hvcs_get_partner_info(uint32_t unit_address, struct list_head *head,
                        return retval;
                }
 
-               last_p_partition_ID = pi_buff[0];
-               last_p_unit_address = pi_buff[1];
+               last_p_partition_ID = be64_to_cpu(pi_buff[0]);
+               last_p_unit_address = be64_to_cpu(pi_buff[1]);
 
                /* This indicates that there are no further partners */
                if (last_p_partition_ID == ~0UL