All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests: net: af_unix: Fix incorrect args in test result msg
@ 2021-09-17 19:26 Shuah Khan
  2021-09-19 12:20 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Shuah Khan @ 2021-09-17 19:26 UTC (permalink / raw)
  To: davem, kuba, shuah; +Cc: Shuah Khan, netdev, linux-kselftest, linux-kernel

Fix the args to fprintf(). Splitting the message ends up passing
incorrect arg for "sigurg %d" and an extra arg overall. The test
result message ends up incorrect.

test_unix_oob.c: In function ‘main’:
test_unix_oob.c:274:43: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘char *’ [-Wformat=]
  274 |   fprintf(stderr, "Test 3 failed, sigurg %d len %d OOB %c ",
      |                                          ~^
      |                                           |
      |                                           int
      |                                          %s
  275 |   "atmark %d\n", signal_recvd, len, oob, atmark);
      |   ~~~~~~~~~~~~~
      |   |
      |   char *
test_unix_oob.c:274:19: warning: too many arguments for format [-Wformat-extra-args]
  274 |   fprintf(stderr, "Test 3 failed, sigurg %d len %d OOB %c ",

Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
---
 tools/testing/selftests/net/af_unix/test_unix_oob.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/af_unix/test_unix_oob.c b/tools/testing/selftests/net/af_unix/test_unix_oob.c
index 0f3e3763f4f8..3dece8b29253 100644
--- a/tools/testing/selftests/net/af_unix/test_unix_oob.c
+++ b/tools/testing/selftests/net/af_unix/test_unix_oob.c
@@ -271,8 +271,9 @@ main(int argc, char **argv)
 	read_oob(pfd, &oob);
 
 	if (!signal_recvd || len != 127 || oob != '%' || atmark != 1) {
-		fprintf(stderr, "Test 3 failed, sigurg %d len %d OOB %c ",
-		"atmark %d\n", signal_recvd, len, oob, atmark);
+		fprintf(stderr,
+			"Test 3 failed, sigurg %d len %d OOB %c atmark %d\n",
+			signal_recvd, len, oob, atmark);
 		die(1);
 	}
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] selftests: net: af_unix: Fix incorrect args in test result msg
  2021-09-17 19:26 [PATCH] selftests: net: af_unix: Fix incorrect args in test result msg Shuah Khan
@ 2021-09-19 12:20 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-09-19 12:20 UTC (permalink / raw)
  To: Shuah Khan; +Cc: davem, kuba, shuah, netdev, linux-kselftest, linux-kernel

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Fri, 17 Sep 2021 13:26:14 -0600 you wrote:
> Fix the args to fprintf(). Splitting the message ends up passing
> incorrect arg for "sigurg %d" and an extra arg overall. The test
> result message ends up incorrect.
> 
> test_unix_oob.c: In function ‘main’:
> test_unix_oob.c:274:43: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘char *’ [-Wformat=]
>   274 |   fprintf(stderr, "Test 3 failed, sigurg %d len %d OOB %c ",
>       |                                          ~^
>       |                                           |
>       |                                           int
>       |                                          %s
>   275 |   "atmark %d\n", signal_recvd, len, oob, atmark);
>       |   ~~~~~~~~~~~~~
>       |   |
>       |   char *
> test_unix_oob.c:274:19: warning: too many arguments for format [-Wformat-extra-args]
>   274 |   fprintf(stderr, "Test 3 failed, sigurg %d len %d OOB %c ",
> 
> [...]

Here is the summary with links:
  - selftests: net: af_unix: Fix incorrect args in test result msg
    https://git.kernel.org/netdev/net/c/48514a223330

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-19 12:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-17 19:26 [PATCH] selftests: net: af_unix: Fix incorrect args in test result msg Shuah Khan
2021-09-19 12:20 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.