diff mbox series

selftests: seccomp: fix format-zero-length warnings

Message ID 20240603115447.30279-1-amer.shanawany@gmail.com (mailing list archive)
State Changes Requested
Headers show
Series selftests: seccomp: fix format-zero-length warnings | expand

Commit Message

Amer Al Shanawany June 3, 2024, 11:54 a.m. UTC
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/
Signed-off-by: Amer Al Shanawany <amer.shanawany@gmail.com>
---
 tools/testing/selftests/seccomp/seccomp_benchmark.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Shuah Khan June 6, 2024, 10:41 p.m. UTC | #1
On 6/3/24 05:54, Amer Al Shanawany wrote:
> 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/
> Signed-off-by: Amer Al Shanawany <amer.shanawany@gmail.com>
> ---
>   tools/testing/selftests/seccomp/seccomp_benchmark.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/testing/selftests/seccomp/seccomp_benchmark.c b/tools/testing/selftests/seccomp/seccomp_benchmark.c
> index b83099160fbc..ed04b89de9c6 100644
> --- a/tools/testing/selftests/seccomp/seccomp_benchmark.c
> +++ b/tools/testing/selftests/seccomp/seccomp_benchmark.c
> @@ -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(" ");

Why not delete this all together?

>   	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(" ");

Why not delete this all together?

>   	system("grep -H . /proc/sys/net/core/bpf_jit_enable");
> -	ksft_print_msg("");
> +	ksft_print_msg(" ");

Why not delete this all together?

>   	system("grep -H . /proc/sys/net/core/bpf_jit_harden");
>   
>   	affinity();

thanks,
-- Shuah
diff mbox series

Patch

diff --git a/tools/testing/selftests/seccomp/seccomp_benchmark.c b/tools/testing/selftests/seccomp/seccomp_benchmark.c
index b83099160fbc..ed04b89de9c6 100644
--- a/tools/testing/selftests/seccomp/seccomp_benchmark.c
+++ b/tools/testing/selftests/seccomp/seccomp_benchmark.c
@@ -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(" ");
 	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(" ");
 	system("grep -H . /proc/sys/net/core/bpf_jit_enable");
-	ksft_print_msg("");
+	ksft_print_msg(" ");
 	system("grep -H . /proc/sys/net/core/bpf_jit_harden");
 
 	affinity();