static unsigned int __read_mostly regs_sz;
/* Offset into context of the beginning of PMU register block */
static const unsigned int regs_off =
- sizeof(((struct xen_pmu_intel_ctxt *)0)->fixed_counters) +
- sizeof(((struct xen_pmu_intel_ctxt *)0)->arch_counters);
+ sizeof_field(struct xen_pmu_intel_ctxt, fixed_counters) +
+ sizeof_field(struct xen_pmu_intel_ctxt, arch_counters);
/*
* QUIRK to workaround an issue on various family 6 cpus.
total_pages = nr_pages;
/* Sanity check for unwanted bloat of certain hypercall structures. */
- BUILD_BUG_ON(sizeof(((struct xen_platform_op *)0)->u) !=
- sizeof(((struct xen_platform_op *)0)->u.pad));
- BUILD_BUG_ON(sizeof(((struct xen_domctl *)0)->u) !=
- sizeof(((struct xen_domctl *)0)->u.pad));
- BUILD_BUG_ON(sizeof(((struct xen_sysctl *)0)->u) !=
- sizeof(((struct xen_sysctl *)0)->u.pad));
+ BUILD_BUG_ON(sizeof_field(struct xen_platform_op, u) !=
+ sizeof_field(struct xen_platform_op, u.pad));
+ BUILD_BUG_ON(sizeof_field(struct xen_domctl, u) !=
+ sizeof_field(struct xen_domctl, u.pad));
+ BUILD_BUG_ON(sizeof_field(struct xen_sysctl, u) !=
+ sizeof_field(struct xen_sysctl, u.pad));
BUILD_BUG_ON(sizeof(start_info_t) > PAGE_SIZE);
BUILD_BUG_ON(sizeof(shared_info_t) > PAGE_SIZE);
BUILD_BUG_ON(sizeof(struct vcpu_info) != 64);
- BUILD_BUG_ON(sizeof(((struct compat_platform_op *)0)->u) !=
- sizeof(((struct compat_platform_op *)0)->u.pad));
+ BUILD_BUG_ON(sizeof_field(struct compat_platform_op, u) !=
+ sizeof_field(struct compat_platform_op, u.pad));
BUILD_BUG_ON(sizeof(start_info_compat_t) > PAGE_SIZE);
BUILD_BUG_ON(sizeof(struct compat_vcpu_info) != 64);