diff options
author | Anton Blanchard <anton@samba.org> | 2014-04-22 09:01:27 +0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-04-28 07:11:24 +0400 |
commit | 2d6b63bbdd7a649ea17fae19f8bab07d4b292a09 (patch) | |
tree | f2645d5a95f7c8089dfb5b53b4048348f74455ac /arch/powerpc/platforms/powernv/opal-dump.c | |
parent | 3441f04b4b62758a798f9fbbf2047dfedf0329a5 (diff) | |
download | linux-2d6b63bbdd7a649ea17fae19f8bab07d4b292a09.tar.xz |
powerpc/powernv: Fix little endian issues in OPAL dump code
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/powernv/opal-dump.c')
-rw-r--r-- | arch/powerpc/platforms/powernv/opal-dump.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/powernv/opal-dump.c b/arch/powerpc/platforms/powernv/opal-dump.c index f0b472427c57..788a1977b9a5 100644 --- a/arch/powerpc/platforms/powernv/opal-dump.c +++ b/arch/powerpc/platforms/powernv/opal-dump.c @@ -209,15 +209,20 @@ static struct kobj_type dump_ktype = { .default_attrs = dump_default_attrs, }; -static int64_t dump_read_info(uint32_t *id, uint32_t *size, uint32_t *type) +static int64_t dump_read_info(uint32_t *dump_id, uint32_t *dump_size, uint32_t *dump_type) { + __be32 id, size, type; int rc; - *type = 0xffffffff; - rc = opal_dump_info2(id, size, type); + type = cpu_to_be32(0xffffffff); + rc = opal_dump_info2(&id, &size, &type); if (rc == OPAL_PARAMETER) - rc = opal_dump_info(id, size); + rc = opal_dump_info(&id, &size); + + *dump_id = be32_to_cpu(id); + *dump_size = be32_to_cpu(size); + *dump_type = be32_to_cpu(type); if (rc) pr_warn("%s: Failed to get dump info (%d)\n", |