[PATCH i-g-t v5 4/9] lib/igt_perf: fix scan formatting for 32-bit compilation

Kamil Konieczny kamil.konieczny at linux.intel.com
Tue Jun 3 14:06:36 UTC 2025


Hi Jan,
On 2025-06-03 at 11:11:02 +0000, Jan Sokolowski wrote:
> 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>

Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.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..fe60241a4 100644
> --- a/lib/igt_perf.c
> +++ b/lib/igt_perf.c
> @@ -1,5 +1,6 @@
>  #include <errno.h>
>  #include <fcntl.h>
> +#include <inttypes.h>
>  #include <limits.h>
>  #include <stdint.h>
>  #include <stdlib.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