[PATCH] selftests/memfd: fix mfd_fail_open() to pass in buf to printf

Subsystems: kernel selftest framework, the rest

STALE4363d

3 messages, 2 authors, 2014-09-04 · open the first message on its own page

[PATCH] selftests/memfd: fix mfd_fail_open() to pass in buf to printf

From: Shuah Khan <hidden>
Date: 2014-09-04 15:07:28

mfd_fail_open() doesn't pass in the buffer to printf resulting
in the following warning:

memfd_test.c: In function ‘mfd_fail_open’:
memfd_test.c:208:3: warning: format ‘%s’ expects a matching ‘char *’ argument [-Wformat=]
   printf("open(%s) didn't fail as expected\n");
   ^

This change fixes the problem.

Signed-off-by: Shuah Khan <redacted>
---
 tools/testing/selftests/memfd/memfd_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/memfd/memfd_test.c b/tools/testing/selftests/memfd/memfd_test.c
index cb5001b..0b9eafb 100644
--- a/tools/testing/selftests/memfd/memfd_test.c
+++ b/tools/testing/selftests/memfd/memfd_test.c
@@ -203,7 +203,7 @@ static void mfd_fail_open(int fd, int flags, mode_t mode)
 	sprintf(buf, "/proc/self/fd/%d", fd);
 	r = open(buf, flags, mode);
 	if (r >= 0) {
-		printf("open(%s) didn't fail as expected\n");
+		printf("open(%s) didn't fail as expected\n", buf);
 		abort();
 	}
 }
-- 
1.9.1

Re: [PATCH] selftests/memfd: fix mfd_fail_open() to pass in buf to printf

From: Pranith Kumar <hidden>
Date: 2014-09-04 15:17:03

On Thu, Sep 4, 2014 at 11:07 AM, Shuah Khan [off-list ref] wrote:
mfd_fail_open() doesn't pass in the buffer to printf resulting
in the following warning:

memfd_test.c: In function ‘mfd_fail_open’:
memfd_test.c:208:3: warning: format ‘%s’ expects a matching ‘char *’ argument [-Wformat=]
   printf("open(%s) didn't fail as expected\n");
   ^

This change fixes the problem.

Signed-off-by: Shuah Khan <redacted>
Hi Shuah,

I already sent in a patch to fix this:

https://lkml.org/lkml/2014/8/31/85

Can you please pick that up?

Thanks!
-- 
Pranith

Re: [PATCH] selftests/memfd: fix mfd_fail_open() to pass in buf to printf

From: Shuah Khan <hidden>
Date: 2014-09-04 15:21:37

On 09/04/2014 09:16 AM, Pranith Kumar wrote:
On Thu, Sep 4, 2014 at 11:07 AM, Shuah Khan [off-list ref] wrote:
quoted
mfd_fail_open() doesn't pass in the buffer to printf resulting
in the following warning:

memfd_test.c: In function ‘mfd_fail_open’:
memfd_test.c:208:3: warning: format ‘%s’ expects a matching ‘char *’ argument [-Wformat=]
   printf("open(%s) didn't fail as expected\n");
   ^

This change fixes the problem.

Signed-off-by: Shuah Khan <redacted>
Hi Shuah,

I already sent in a patch to fix this:

https://lkml.org/lkml/2014/8/31/85

Can you please pick that up?
Hi Pranith,

Great. Could you please resend it to me cc'ing linux-api as well.

thanks,
-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Samsung Research America (Silicon Valley)
shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org | (970) 217-8978
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help