diff mbox series

[v2,8/8] selftests/resctrl: Fix wrong format specifier

Message ID a10dfa9cbfec05e8056744bc5e3ac0697a4fbd9b.1693829810.git.maciej.wieczor-retman@intel.com (mailing list archive)
State Accepted
Commit 27c734f4402243f478348108d8a2ebd6e3e5e8a3
Headers show
Series Add printf attribute to kselftest functions | expand

Commit Message

Maciej Wieczor-Retman Sept. 4, 2023, 12:44 p.m. UTC
A long unsigned int variable is passed to the ksft_print_msg() and the
format specifier used expects a variable of type int.

Change the format specifier to match the passed variable.

Signed-off-by: Wieczor-Retman Maciej <maciej.wieczor-retman@intel.com>
---
Changelog v2:
- Added this patch to the series.

 tools/testing/selftests/resctrl/cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ilpo Järvinen Sept. 4, 2023, 1:14 p.m. UTC | #1
On Mon, 4 Sep 2023, Wieczor-Retman Maciej wrote:

> A long unsigned int variable is passed to the ksft_print_msg() and the
> format specifier used expects a variable of type int.
> 
> Change the format specifier to match the passed variable.
> 
> Signed-off-by: Wieczor-Retman Maciej <maciej.wieczor-retman@intel.com>
> ---
> Changelog v2:
> - Added this patch to the series.
> 
>  tools/testing/selftests/resctrl/cache.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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));

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
diff mbox series

Patch

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