selftests/resctrl: Fix wrong format specifier
authorMaciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
Fri, 13 Oct 2023 11:36:32 +0000 (13:36 +0200)
committerShuah Khan <skhan@linuxfoundation.org>
Fri, 13 Oct 2023 20:08:42 +0000 (14:08 -0600)
Compiling resctrl selftest after adding a __printf() attribute to
ksft_print_msg() exposes -Wformat warning in show_cache_info().
The format specifier used expects a variable of type int but a long
unsigned int variable is passed instead.

Change the format specifier to match the passed variable.

Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/resctrl/cache.c

index d3cbb829ff6a70db3e1ad1f0442e326b24af223c..a5d082cd2d53f15c4a7f535f437fe0a66408d86c 100644 (file)
@@ -294,7 +294,7 @@ int show_cache_info(unsigned long sum_llc_val, int no_of_bits,
        ret = platform && abs((int)diff_percent) > max_diff_percent &&
              (cmt ? (abs(avg_diff) > max_diff) : true);
 
-       ksft_print_msg("%s Check cache miss rate within %d%%\n",
+       ksft_print_msg("%s Check cache miss rate within %lu%%\n",
                       ret ? "Fail:" : "Pass:", max_diff_percent);
 
        ksft_print_msg("Percent diff=%d\n", abs((int)diff_percent));