aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
Diffstat (limited to 'target')
-rw-r--r--target/i386/kvm.c2
-rw-r--r--target/ppc/arch_dump.c10
-rw-r--r--target/s390x/arch_dump.c20
3 files changed, 16 insertions, 16 deletions
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index c5f72d6..032f0ad 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -1565,7 +1565,7 @@ static int kvm_put_fpu(X86CPU *cpu)
#define XSAVE_PKRU 672
#define XSAVE_BYTE_OFFSET(word_offset) \
- ((word_offset) * sizeof(((struct kvm_xsave *)0)->region[0]))
+ ((word_offset) * sizeof_field(struct kvm_xsave, region[0]))
#define ASSERT_OFFSET(word_offset, field) \
QEMU_BUILD_BUG_ON(XSAVE_BYTE_OFFSET(word_offset) != \
diff --git a/target/ppc/arch_dump.c b/target/ppc/arch_dump.c
index 351a65b..cc1460e 100644
--- a/target/ppc/arch_dump.c
+++ b/target/ppc/arch_dump.c
@@ -210,11 +210,11 @@ static const struct NoteFuncDescStruct {
int contents_size;
void (*note_contents_func)(NoteFuncArg *arg, PowerPCCPU *cpu);
} note_func[] = {
- {sizeof(((Note *)0)->contents.prstatus), ppc_write_elf_prstatus},
- {sizeof(((Note *)0)->contents.fpregset), ppc_write_elf_fpregset},
- {sizeof(((Note *)0)->contents.vmxregset), ppc_write_elf_vmxregset},
- {sizeof(((Note *)0)->contents.vsxregset), ppc_write_elf_vsxregset},
- {sizeof(((Note *)0)->contents.speregset), ppc_write_elf_speregset},
+ {sizeof_field(Note, contents.prstatus), ppc_write_elf_prstatus},
+ {sizeof_field(Note, contents.fpregset), ppc_write_elf_fpregset},
+ {sizeof_field(Note, contents.vmxregset), ppc_write_elf_vmxregset},
+ {sizeof_field(Note, contents.vsxregset), ppc_write_elf_vsxregset},
+ {sizeof_field(Note, contents.speregset), ppc_write_elf_speregset},
{ 0, NULL}
};
diff --git a/target/s390x/arch_dump.c b/target/s390x/arch_dump.c
index 6f61ff9..c9ef0a6 100644
--- a/target/s390x/arch_dump.c
+++ b/target/s390x/arch_dump.c
@@ -184,20 +184,20 @@ typedef struct NoteFuncDescStruct {
} NoteFuncDesc;
static const NoteFuncDesc note_core[] = {
- {sizeof(((Note *)0)->contents.prstatus), s390x_write_elf64_prstatus},
- {sizeof(((Note *)0)->contents.fpregset), s390x_write_elf64_fpregset},
+ {sizeof_field(Note, contents.prstatus), s390x_write_elf64_prstatus},
+ {sizeof_field(Note, contents.fpregset), s390x_write_elf64_fpregset},
{ 0, NULL}
};
static const NoteFuncDesc note_linux[] = {
- {sizeof(((Note *)0)->contents.prefix), s390x_write_elf64_prefix},
- {sizeof(((Note *)0)->contents.ctrs), s390x_write_elf64_ctrs},
- {sizeof(((Note *)0)->contents.timer), s390x_write_elf64_timer},
- {sizeof(((Note *)0)->contents.todcmp), s390x_write_elf64_todcmp},
- {sizeof(((Note *)0)->contents.todpreg), s390x_write_elf64_todpreg},
- {sizeof(((Note *)0)->contents.vregslo), s390x_write_elf64_vregslo},
- {sizeof(((Note *)0)->contents.vregshi), s390x_write_elf64_vregshi},
- {sizeof(((Note *)0)->contents.gscb), s390x_write_elf64_gscb},
+ {sizeof_field(Note, contents.prefix), s390x_write_elf64_prefix},
+ {sizeof_field(Note, contents.ctrs), s390x_write_elf64_ctrs},
+ {sizeof_field(Note, contents.timer), s390x_write_elf64_timer},
+ {sizeof_field(Note, contents.todcmp), s390x_write_elf64_todcmp},
+ {sizeof_field(Note, contents.todpreg), s390x_write_elf64_todpreg},
+ {sizeof_field(Note, contents.vregslo), s390x_write_elf64_vregslo},
+ {sizeof_field(Note, contents.vregshi), s390x_write_elf64_vregshi},
+ {sizeof_field(Note, contents.gscb), s390x_write_elf64_gscb},
{ 0, NULL}
};