Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: kvm: Fix -Wformat warnings

Fixes the following warnings:

dirty_log_test.c: In function ‘help’:
dirty_log_test.c:216:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat=]
printf(" -i: specify iteration counts (default: %"PRIu64")\n",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/test_util.h:18:0,
from dirty_log_test.c:16:
/usr/include/inttypes.h:105:34: note: format string is defined here
# define PRIu64 __PRI64_PREFIX "u"
dirty_log_test.c:218:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat=]
printf(" -I: specify interval in ms (default: %"PRIu64" ms)\n",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/test_util.h:18:0,
from dirty_log_test.c:16:
/usr/include/inttypes.h:105:34: note: format string is defined here
# define PRIu64 __PRI64_PREFIX "u"

Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>

authored by

Andrea Parri and committed by
Shuah Khan (Samsung OSG)
fb363e2d 8f381ac4

+2 -2
+2 -2
tools/testing/selftests/kvm/dirty_log_test.c
··· 31 31 /* How many pages to dirty for each guest loop */ 32 32 #define TEST_PAGES_PER_LOOP 1024 33 33 /* How many host loops to run (one KVM_GET_DIRTY_LOG for each loop) */ 34 - #define TEST_HOST_LOOP_N 32 34 + #define TEST_HOST_LOOP_N 32UL 35 35 /* Interval for each host loop (ms) */ 36 - #define TEST_HOST_LOOP_INTERVAL 10 36 + #define TEST_HOST_LOOP_INTERVAL 10UL 37 37 38 38 /* 39 39 * Guest variables. We use these variables to share data between host