From: Maciej Wieczor-Retman Date: Fri, 13 Oct 2023 11:36:32 +0000 (+0200) Subject: selftests/resctrl: Fix wrong format specifier X-Git-Tag: io_uring-6.7-2023-11-10~37^2~25 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=27c734f4402243f478348108d8a2ebd6e3e5e8a3;p=linux-2.6-block.git selftests/resctrl: Fix wrong format specifier 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 Reviewed-by: Ilpo Järvinen Reviewed-by: Reinette Chatre Signed-off-by: Shuah Khan --- diff --git a/tools/testing/selftests/resctrl/cache.c b/tools/testing/selftests/resctrl/cache.c index d3cbb829ff6a..a5d082cd2d53 100644 --- a/tools/testing/selftests/resctrl/cache.c +++ b/tools/testing/selftests/resctrl/cache.c @@ -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));