]> www.infradead.org Git - linux.git/commitdiff
selftests: seccomp: fix format-zero-length warnings
authorAmer Al Shanawany <amer.shanawany@gmail.com>
Tue, 11 Jun 2024 15:16:08 +0000 (17:16 +0200)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 11 Jun 2024 15:25:43 +0000 (09:25 -0600)
fix the following errors by using string format specifier and an empty
parameter:

seccomp_benchmark.c:197:24: warning: zero-length gnu_printf format
 string [-Wformat-zero-length]
  197 |         ksft_print_msg("");
      |                        ^~
seccomp_benchmark.c:202:24: warning: zero-length gnu_printf format
 string [-Wformat-zero-length]
  202 |         ksft_print_msg("");
      |                        ^~
seccomp_benchmark.c:204:24: warning: zero-length gnu_printf format
 string [-Wformat-zero-length]
  204 |         ksft_print_msg("");
      |                        ^~

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202312260235.Uj5ug8K9-lkp@intel.com/
Suggested-by: Kees Cook <kees@kernel.org>
Signed-off-by: Amer Al Shanawany <amer.shanawany@gmail.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/seccomp/seccomp_benchmark.c

index b83099160fbcaae141146795ae718a4cdbd7fa26..94886c82ae609f890965b03a4207f53a8b5ec3f6 100644 (file)
@@ -194,14 +194,14 @@ int main(int argc, char *argv[])
        ksft_set_plan(7);
 
        ksft_print_msg("Running on:\n");
-       ksft_print_msg("");
+       ksft_print_msg("%s", "");
        system("uname -a");
 
        ksft_print_msg("Current BPF sysctl settings:\n");
        /* Avoid using "sysctl" which may not be installed. */
-       ksft_print_msg("");
+       ksft_print_msg("%s", "");
        system("grep -H . /proc/sys/net/core/bpf_jit_enable");
-       ksft_print_msg("");
+       ksft_print_msg("%s", "");
        system("grep -H . /proc/sys/net/core/bpf_jit_harden");
 
        affinity();