x86/pmu: Fix compilation on macOS
PATCH 1/1 x86/pmu: Fix compilation on macOS
From: Thomas Huth <[email protected]>
Compiling for i686 on macOS in the CI currently fails with:
.../cirrus-ci-build/x86/pmu.c: In function 'main':.../cirrus-ci-build/x86/pmu.c:1012:41: error: format '%x' expects argument of
type 'unsigned int', but argument 2 has type 'u32' {aka 'long unsigned int'} [-Werror=format=]
1012 | printf("Arch Events (mask): 0x%x\n", pmu.arch_event_available);
| ~^ ~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | u32 {aka long unsigned int}
| unsigned int
| %lxUse the correct format string for u32 to fix this issue.
Fixes 92dc5f7a ("x86/pmu: Mark Intel architectural event available [...]")
Signed-off-by Thomas Huth <[email protected]>
--- x86/pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
x86/pmu.c +1 -1
@@ -1009,7 +1009,7 @@ int main(int ac, char **av)printf ("GP counters: %d\n" , pmu.nr_gp_counters);printf ("GP counter width: %d\n" , pmu.gp_counter_width);printf ("Event Mask length: %d\n" , pmu.arch_event_mask_length); -printf ("Arch Events (mask): 0x%x\n" , pmu.arch_event_available); +printf ("Arch Events (mask): 0x%" PRIx32"\n" , pmu.arch_event_available);printf ("Fixed counters: %d\n" , pmu.nr_fixed_counters);printf ("Fixed counter width: %d\n" , pmu.fixed_counter_width);
Signature · 1 line
2.50.1