selftests/cachestat: Fix print_cachestat format
authorMaciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
Fri, 13 Oct 2023 11:36:26 +0000 (13:36 +0200)
committerShuah Khan <skhan@linuxfoundation.org>
Fri, 13 Oct 2023 20:08:10 +0000 (14:08 -0600)
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>
tools/testing/selftests/cachestat/test_cachestat.c

index 4804c7dc7b3125c13a7e26be9928d550f289e7ab..b171fd53b004e8372bf9e73bdce84e5429d79b11 100644 (file)
@@ -27,7 +27,7 @@ static const char * const dev_files[] = {
 void print_cachestat(struct cachestat *cs)
 {
        ksft_print_msg(
-       "Using cachestat: Cached: %lu, Dirty: %lu, Writeback: %lu, Evicted: %lu, Recently Evicted: %lu\n",
+       "Using cachestat: Cached: %llu, Dirty: %llu, Writeback: %llu, Evicted: %llu, Recently Evicted: %llu\n",
        cs->nr_cache, cs->nr_dirty, cs->nr_writeback,
        cs->nr_evicted, cs->nr_recently_evicted);
 }