Commit 25dde3f1 authored by Abhinav Jain's avatar Abhinav Jain Committed by JSY
Browse files

selftest: af_unix: Fix kselftest compilation warnings

mainline inclusion
from mainline-v6.11-rc4
commit 6c569b77f0300f8a9960277c7094fa0f128eb811
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IB6B61

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6c569b77f0300f8a9960277c7094fa0f128eb811



--------------------------------

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.")
Signed-off-by: default avatarAbhinav Jain <jain.abhinav177@gmail.com>
Reviewed-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20240814080743.1156166-1-jain.abhinav177@gmail.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarJiangshan Yi <yijiangshan@kylinos.cn>
parent 981bd7ec
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -95,7 +95,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;