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

Kamil Konieczny kamil.konieczny at linux.intel.com
Tue May 27 16:13:54 UTC 2025


Hi Jan,
On 2025-05-27 at 12:04:16 +0000, Jan Sokolowski wrote:

please improve subject (follow guide for 1/9 patch)

> 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>

Still in wrong place, place it in alphabeticall order,
before limits.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);

This is ok.

Regards,
Kamil

>  	if (ret != 1)
>  		return -EINVAL;
>  
> -- 
> 2.34.1
> 


More information about the igt-dev mailing list