]> git.itanic.dy.fi Git - linux-stable/commit
selftests: kselftest_harness: fix Clang warning about zero-length format
authorJakub Kicinski <kuba@kernel.org>
Tue, 16 Apr 2024 15:10:48 +0000 (08:10 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 18 Apr 2024 01:35:49 +0000 (18:35 -0700)
commitcaed8eba221533123192d39cc947f45cbb1e1db5
treeb2d4d084d326f9470c2079703305657a515dc9b7
parent0f022d32c3eca477fbf79a205243a6123ed0fe11
selftests: kselftest_harness: fix Clang warning about zero-length format

Apparently it's more legal to pass the format as NULL, than
it is to use an empty string. Clang complains about empty
formats:

./../kselftest_harness.h:1207:30: warning: format string is empty
[-Wformat-zero-length]
 1207 |            diagnostic ? "%s" : "", diagnostic);
      |                                 ^~
1 warning generated.

Reported-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/all/20240409224256.1581292-1-seanjc@google.com
Fixes: 378193eff339 ("selftests: kselftest_harness: let PASS / FAIL provide diagnostic")
Tested-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Link: https://lore.kernel.org/r/20240416151048.1682352-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/kselftest.h
tools/testing/selftests/kselftest_harness.h