* [PATCH] userfaultfd: selftest: fix compiler warning
@ 2019-05-27 15:18 Alakesh Haloi
2019-05-28 2:17 ` Peter Xu
2019-05-28 5:33 ` Mike Rapoport
0 siblings, 2 replies; 3+ messages in thread
From: Alakesh Haloi @ 2019-05-27 15:18 UTC (permalink / raw)
To: linux-kselftest, linux-kernel, Peter Xu, Andrew Morton,
Mike Rapoport, Shuah Khan
Fixes following compiler warning
userfaultfd.c: In function ‘usage’:
userfaultfd.c:126:2: warning: format not a string literal and no format
arguments [-Wformat-security]
fprintf(stderr, examples);
Signed-off-by: Alakesh Haloi <alakesh.haloi@gmail.com>
---
tools/testing/selftests/vm/userfaultfd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c
index 5d1db824f73a..b3e6497b080c 100644
--- a/tools/testing/selftests/vm/userfaultfd.c
+++ b/tools/testing/selftests/vm/userfaultfd.c
@@ -123,7 +123,7 @@ static void usage(void)
fprintf(stderr, "Supported <test type>: anon, hugetlb, "
"hugetlb_shared, shmem\n\n");
fprintf(stderr, "Examples:\n\n");
- fprintf(stderr, examples);
+ fprintf(stderr, "%s", examples);
exit(1);
}
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] userfaultfd: selftest: fix compiler warning
2019-05-27 15:18 [PATCH] userfaultfd: selftest: fix compiler warning Alakesh Haloi
@ 2019-05-28 2:17 ` Peter Xu
2019-05-28 5:33 ` Mike Rapoport
1 sibling, 0 replies; 3+ messages in thread
From: Peter Xu @ 2019-05-28 2:17 UTC (permalink / raw)
To: Alakesh Haloi
Cc: linux-kselftest, linux-kernel, Andrew Morton, Mike Rapoport, Shuah Khan
On Mon, May 27, 2019 at 03:18:59PM +0000, Alakesh Haloi wrote:
> Fixes following compiler warning
>
> userfaultfd.c: In function ‘usage’:
> userfaultfd.c:126:2: warning: format not a string literal and no format
> arguments [-Wformat-security]
> fprintf(stderr, examples);
>
> Signed-off-by: Alakesh Haloi <alakesh.haloi@gmail.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
--
Peter Xu
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] userfaultfd: selftest: fix compiler warning
2019-05-27 15:18 [PATCH] userfaultfd: selftest: fix compiler warning Alakesh Haloi
2019-05-28 2:17 ` Peter Xu
@ 2019-05-28 5:33 ` Mike Rapoport
1 sibling, 0 replies; 3+ messages in thread
From: Mike Rapoport @ 2019-05-28 5:33 UTC (permalink / raw)
To: Alakesh Haloi
Cc: linux-kselftest, linux-kernel, Peter Xu, Andrew Morton,
Mike Rapoport, Shuah Khan
On Mon, May 27, 2019 at 03:18:59PM +0000, Alakesh Haloi wrote:
> Fixes following compiler warning
>
> userfaultfd.c: In function ‘usage’:
> userfaultfd.c:126:2: warning: format not a string literal and no format
> arguments [-Wformat-security]
> fprintf(stderr, examples);
>
> Signed-off-by: Alakesh Haloi <alakesh.haloi@gmail.com>
Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
> ---
> tools/testing/selftests/vm/userfaultfd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c
> index 5d1db824f73a..b3e6497b080c 100644
> --- a/tools/testing/selftests/vm/userfaultfd.c
> +++ b/tools/testing/selftests/vm/userfaultfd.c
> @@ -123,7 +123,7 @@ static void usage(void)
> fprintf(stderr, "Supported <test type>: anon, hugetlb, "
> "hugetlb_shared, shmem\n\n");
> fprintf(stderr, "Examples:\n\n");
> - fprintf(stderr, examples);
> + fprintf(stderr, "%s", examples);
> exit(1);
> }
>
> --
> 2.17.1
>
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-05-28 5:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-27 15:18 [PATCH] userfaultfd: selftest: fix compiler warning Alakesh Haloi
2019-05-28 2:17 ` Peter Xu
2019-05-28 5:33 ` Mike Rapoport
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).