Skip to content

Commit ee593b0

Browse files
committed
selftests/cachestat: Fix print_cachestat format
JIRA: https://issues.redhat.com/browse/RHEL-50302 commit 3aa779a Author: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> Date: Fri Oct 13 13:36:26 2023 +0200 selftests/cachestat: Fix print_cachestat format Compiling cachestat selftest after adding a __printf() attribute to ksft_print_msg() exposes a -Wformat warning in print_cachestat(). The format specifier in printf() call expects long int variables and received long long int. Change format specifiers to long long int so they match passed variables. Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> Acked-by: Nhat Pham <nphamcs@gmail.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Eric Chanudet <echanude@redhat.com>
1 parent 16dec0a commit ee593b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/cachestat/test_cachestat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static const char * const dev_files[] = {
2727
void print_cachestat(struct cachestat *cs)
2828
{
2929
ksft_print_msg(
30-
"Using cachestat: Cached: %lu, Dirty: %lu, Writeback: %lu, Evicted: %lu, Recently Evicted: %lu\n",
30+
"Using cachestat: Cached: %llu, Dirty: %llu, Writeback: %llu, Evicted: %llu, Recently Evicted: %llu\n",
3131
cs->nr_cache, cs->nr_dirty, cs->nr_writeback,
3232
cs->nr_evicted, cs->nr_recently_evicted);
3333
}

0 commit comments

Comments
 (0)