Skip to contentSkip to conversation

selftest: af_unix: Fix kselftest compilation warnings

PATCH Applied Abhinav Jain 2 participants 2 messages Aug 14, 2024 – Aug 15, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 selftest: af_unix: Fix kselftest compilation warnings

Change expected_buf from (const void *) to (const char *) in function __recvpair().
This change fixes the below warnings during test compilation:

```
In file included from msg_oob.c:14:
msg_oob.c: In function ‘__recvpair’:

../../kselftest_harness.h:106:40: warning: format ‘%s’ expects argument
of type ‘char *’,but argument 6 has type ‘const void *’ [-Wformat=]

../../kselftest_harness.h:101:17: note: in expansion of macro ‘__TH_LOG’
msg_oob.c:235:17: note: in expansion of macro ‘TH_LOG’

../../kselftest_harness.h:106:40: warning: format ‘%s’ expects argument
of type ‘char *’,but argument 6 has type ‘const void *’ [-Wformat=]

../../kselftest_harness.h:101:17: note: in expansion of macro ‘__TH_LOG’
msg_oob.c:259:25: note: in expansion of macro ‘TH_LOG’
```
Fixes d098d77232c3 ("selftest: af_unix: Add msg_oob.c.")

---

v2:
https://lore.kernel.org/all/[email protected]/

- Change the parameter expected_buf from (const void *) to (const char *) in the function __recvpair() as per the feedback in v1.
- Add Fixes tag as per feedback in v1.

v1:
https://lore.kernel.org/netdev/[email protected]

---
 tools/testing/selftests/net/af_unix/msg_oob.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/af_unix/msg_oob.c +1 -1
index 16d0c172eaeb..535eb2c3d7d1 100644
@@ -209,7 +209,7 @@ static void __sendpair(struct __test_metadata *_metadata,
 
 static void __recvpair(struct __test_metadata *_metadata,
 		       FIXTURE_DATA(msg_oob) *self,
-		       const void *expected_buf, int expected_len,
+		       const char *expected_buf, int expected_len,
 		       int buf_len, int flags)
 {
 	int i, ret[2], recv_errno[2], expected_errno = 0;
Signature · 1 line
2.34.1
#1 lore raw
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Wed, 14 Aug 2024 13:37:43 +0530 you wrote:

Change expected_buf from (const void *) to (const char *) in function __recvpair().
This change fixes the below warnings during test compilation:

```
In file included from msg_oob.c:14:
msg_oob.c: In function ‘__recvpair’:

[...]

Here is the summary with links:
- [net,v3] selftest: af_unix: Fix kselftest compilation warnings

    https://git.kernel.org/netdev/net/c/6c569b77f030

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html