Linux userland API discussions
 help / color / mirror / Atom feed
* [PATCH] selftests/memfd: fix mfd_fail_open() to pass in buf to printf
@ 2014-09-04 15:07 Shuah Khan
       [not found] ` <1409843242-6596-1-git-send-email-shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Shuah Khan @ 2014-09-04 15:07 UTC (permalink / raw)
  To: dh.herrmann-Re5JQEeQqe8AvxtiuMwx3w,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	bobby.prani-Re5JQEeQqe8AvxtiuMwx3w, hughd-hpIqsD4AKlfQT0dZR+AlfA
  Cc: Shuah Khan, linux-api-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

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 <shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
---
 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

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

end of thread, other threads:[~2014-09-04 15:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-04 15:07 [PATCH] selftests/memfd: fix mfd_fail_open() to pass in buf to printf Shuah Khan
     [not found] ` <1409843242-6596-1-git-send-email-shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
2014-09-04 15:16   ` Pranith Kumar
     [not found]     ` <CAJhHMCCuyC3HUfUktTpkQcxnqJDpA2O0Gqc8wZMq0TwB5PeY6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-09-04 15:21       ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox