selftests/openat2: Fix wrong format specifier
authorMaciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
Fri, 13 Oct 2023 11:36:27 +0000 (13:36 +0200)
committerShuah Khan <skhan@linuxfoundation.org>
Fri, 13 Oct 2023 20:08:16 +0000 (14:08 -0600)
Compiling openat2 selftest after adding a __printf() attribute to
ksft_print_msg() exposes a -Wformat warning in test_openat2_flags().
The wrong format specifier is used for printing test.how->flags
variable.

Change the format specifier to %llX so it matches the printed variable.

Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/openat2/openat2_test.c

index 7fb902099de45e1bb1992ffdc8c916b6e0554feb..9024754530b230d0252905c5e01d327908da092a 100644 (file)
@@ -300,7 +300,7 @@ void test_openat2_flags(void)
 
                        ksft_print_msg("openat2 unexpectedly returned ");
                        if (fdpath)
-                               ksft_print_msg("%d['%s'] with %X (!= %X)\n",
+                               ksft_print_msg("%d['%s'] with %X (!= %llX)\n",
                                               fd, fdpath, fdflags,
                                               test->how.flags);
                        else