Skip to contentSkip to conversation

selftests/perf_events: use the ll64 types on powerpc64

PATCH New Sasha Levin 2 participants 2 messages Nov 3 – Nov 5 Kselftest

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/perf_events: use the ll64 types on powerpc64

On powerpc64 __u64 is an unsigned long unless __SANE_USERSPACE_TYPES__ is defined, so printing attr.config with %llx warns:

watermark_signal.c:85:58: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type '__u64' {aka 'long unsigned int'} [-Wformat=]

Define __SANE_USERSPACE_TYPES__, as other selftests do.

---
KernelCI's powerpc kselftest builds show this. The define makes the same change on alpha and mips64 and none on the other architectures; the x86_64 and 32-bit builds don't change.

 tools/testing/selftests/perf_events/watermark_signal.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/perf_events/watermark_signal.c +1 -0
index a84709cabd8be..abff011f63161 100644
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 #define _GNU_SOURCE
+#define __SANE_USERSPACE_TYPES__
 
 #include <errno.h>
 #include <fcntl.h>
Signature · 1 line
2.53.0
#1 lore raw
Sashiko has reviewed this patch and found no issues.
Quoted 8 lines

On powerpc64 __u64 is an unsigned long unless __SANE_USERSPACE_TYPES__ is defined, so printing attr.config with %llx warns:

watermark_signal.c:85:58: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type '__u64' {aka 'long unsigned int'} [-Wformat=]

Define __SANE_USERSPACE_TYPES__, as other selftests do.

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1