diff mbox series

[net,v2] selftest: af_unix: Fix kselftest compilation warnings

Message ID 20240812191122.1092806-1-jain.abhinav177@gmail.com
State Superseded
Headers show
Series [net,v2] selftest: af_unix: Fix kselftest compilation warnings | expand

Commit Message

Abhinav Jain Aug. 12, 2024, 7:11 p.m. UTC
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.

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’
```

v1:
lore.kernel.org/netdev/20240810134037.669765-1-jain.abhinav177@gmail.com

Fixes: d098d77232c3 ("selftest: af_unix: Add msg_oob.c.")
Signed-off-by: Abhinav Jain <jain.abhinav177@gmail.com>
---
 tools/testing/selftests/net/af_unix/msg_oob.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jakub Kicinski Aug. 14, 2024, 1:21 a.m. UTC | #1
On Tue, 13 Aug 2024 00:41:22 +0530 Abhinav Jain wrote:
> 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.
> 
> 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’
> ```
> 
> v1:
> lore.kernel.org/netdev/20240810134037.669765-1-jain.abhinav177@gmail.com
> 
> Fixes: d098d77232c3 ("selftest: af_unix: Add msg_oob.c.")
> Signed-off-by: Abhinav Jain <jain.abhinav177@gmail.com>

Some patchwork malfunction, the patch didn't get registered :(
Could you resend?

Please keep Kuniyuki's review tag and address his feedback.
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/af_unix/msg_oob.c b/tools/testing/selftests/net/af_unix/msg_oob.c
index 16d0c172eaeb..535eb2c3d7d1 100644
--- a/tools/testing/selftests/net/af_unix/msg_oob.c
+++ b/tools/testing/selftests/net/af_unix/msg_oob.c
@@ -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;