All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] xfs: silent -Wformat-security warning
@ 2016-12-19 13:41 Nicolas Iooss
  2016-12-19 16:05 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Iooss @ 2016-12-19 13:41 UTC (permalink / raw)
  To: Dave Chinner, linux-xfs; +Cc: linux-kernel, Nicolas Iooss

When building the XFS driver with clang, the compiler reports a
-Wformat-security warning in xlog_recover_validate_buf_type() because
xfs_warn() is being called with a non-literal string. Even though
variable warnmsg is always initialized as a constant string without any
'%' character, silent the warning by calling xfs_warn with "%s" format
string.

Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
---
 fs/xfs/xfs_log_recover.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 4a98762ec8b4..9208296e9f15 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -2572,7 +2572,7 @@ xlog_recover_validate_buf_type(
 		return;
 
 	if (warnmsg) {
-		xfs_warn(mp, warnmsg);
+		xfs_warn(mp, "%s", warnmsg);
 		ASSERT(0);
 	}
 
-- 
2.11.0

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

end of thread, other threads:[~2016-12-19 16:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-19 13:41 [PATCH 1/1] xfs: silent -Wformat-security warning Nicolas Iooss
2016-12-19 16:05 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.