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

selftests: seccomp: fix format-zero-length warnings

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>

authored by

Amer Al Shanawany and committed by
Shuah Khan
04e1f99a 2049aad5

+3 -3
+3 -3
tools/testing/selftests/seccomp/seccomp_benchmark.c
··· 194 194 ksft_set_plan(7); 195 195 196 196 ksft_print_msg("Running on:\n"); 197 - ksft_print_msg(""); 197 + ksft_print_msg("%s", ""); 198 198 system("uname -a"); 199 199 200 200 ksft_print_msg("Current BPF sysctl settings:\n"); 201 201 /* Avoid using "sysctl" which may not be installed. */ 202 - ksft_print_msg(""); 202 + ksft_print_msg("%s", ""); 203 203 system("grep -H . /proc/sys/net/core/bpf_jit_enable"); 204 - ksft_print_msg(""); 204 + ksft_print_msg("%s", ""); 205 205 system("grep -H . /proc/sys/net/core/bpf_jit_harden"); 206 206 207 207 affinity();