* [Qemu-devel] [PATCH] tests: fix acpi to work on bigendian host
@ 2014-01-13 7:33 Alexey Kardashevskiy
2014-01-14 10:52 ` Michael S. Tsirkin
0 siblings, 1 reply; 2+ messages in thread
From: Alexey Kardashevskiy @ 2014-01-13 7:33 UTC (permalink / raw)
To: qemu-devel; +Cc: Alexey Kardashevskiy, Marcel Apfelbaum
Double endianness convertion make this test failing on POWERPC machine
running in big-endian.
This fixes the test to success on big-endian host.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
tests/acpi-test.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/acpi-test.c b/tests/acpi-test.c
index df1af83..30a5e3e 100644
--- a/tests/acpi-test.c
+++ b/tests/acpi-test.c
@@ -51,13 +51,13 @@ typedef struct {
field = readb(addr); \
break; \
case 2: \
- field = le16_to_cpu(readw(addr)); \
+ field = readw(addr); \
break; \
case 4: \
- field = le32_to_cpu(readl(addr)); \
+ field = readl(addr); \
break; \
case 8: \
- field = le64_to_cpu(readq(addr)); \
+ field = readq(addr); \
break; \
default: \
g_assert(false); \
--
1.8.4.rc4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] tests: fix acpi to work on bigendian host
2014-01-13 7:33 [Qemu-devel] [PATCH] tests: fix acpi to work on bigendian host Alexey Kardashevskiy
@ 2014-01-14 10:52 ` Michael S. Tsirkin
0 siblings, 0 replies; 2+ messages in thread
From: Michael S. Tsirkin @ 2014-01-14 10:52 UTC (permalink / raw)
To: Alexey Kardashevskiy; +Cc: qemu-devel, Marcel Apfelbaum
On Mon, Jan 13, 2014 at 06:33:53PM +1100, Alexey Kardashevskiy wrote:
> Double endianness convertion make this test failing on POWERPC machine
> running in big-endian.
>
> This fixes the test to success on big-endian host.
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Yes, readl etc already convert from guest endian-ness to host
endian-ness, and guest is LE.
Applied, thanks.
> ---
> tests/acpi-test.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tests/acpi-test.c b/tests/acpi-test.c
> index df1af83..30a5e3e 100644
> --- a/tests/acpi-test.c
> +++ b/tests/acpi-test.c
> @@ -51,13 +51,13 @@ typedef struct {
> field = readb(addr); \
> break; \
> case 2: \
> - field = le16_to_cpu(readw(addr)); \
> + field = readw(addr); \
> break; \
> case 4: \
> - field = le32_to_cpu(readl(addr)); \
> + field = readl(addr); \
> break; \
> case 8: \
> - field = le64_to_cpu(readq(addr)); \
> + field = readq(addr); \
> break; \
> default: \
> g_assert(false); \
> --
> 1.8.4.rc4
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-01-14 10:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-13 7:33 [Qemu-devel] [PATCH] tests: fix acpi to work on bigendian host Alexey Kardashevskiy
2014-01-14 10:52 ` Michael S. Tsirkin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).