[PATCH i-g-t v4 4/9] lib/igt_perf: fixup scan formatting for files in lib

Jan Sokolowski jan.sokolowski at intel.com
Tue May 27 12:04:16 UTC 2025


Compiling on other architectures than x86-64 causes a lot
of scan formatting warnings.

Fix formatting by using proper formatters, eg. SCNx64.

Cc: Riana Tauro <riana.tauro at intel.com>
Cc: Vinay Belgaumkar <vinay.belgaumkar at intel.com>
Signed-off-by: Jan Sokolowski <jan.sokolowski at intel.com>
---
 lib/igt_perf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/igt_perf.c b/lib/igt_perf.c
index fb2b73915..2b7170094 100644
--- a/lib/igt_perf.c
+++ b/lib/igt_perf.c
@@ -5,6 +5,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/stat.h>
+#include <inttypes.h>
 #ifdef __linux__
 #include <sys/sysinfo.h>
 #include <sys/sysmacros.h>
@@ -157,7 +158,7 @@ int perf_event_config(const char *device, const char *event, uint64_t *config)
 		return -EINVAL;
 
 	buf[bytes] = '\0';
-	ret = sscanf(buf, "event=0x%lx", config);
+	ret = sscanf(buf, "event=0x%" SCNx64, config);
 	if (ret != 1)
 		return -EINVAL;
 
-- 
2.34.1



More information about the igt-dev mailing list