public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs/9p/xattr.c: avoid format-overflow warning
@ 2023-10-08  6:01 Su Hui
  2023-10-09 18:34 ` Christian Schoenebeck
  2023-10-10  7:51 ` Dan Carpenter
  0 siblings, 2 replies; 7+ messages in thread
From: Su Hui @ 2023-10-08  6:01 UTC (permalink / raw)
  To: ericvh, lucho, asmadeus, linux_oss
  Cc: Su Hui, v9fs, linux-kernel, kernel-janitors

with gcc and W=1 option, there's a warning like this:

In file included from fs/9p/xattr.c:12:
In function ‘v9fs_xattr_get’,
    inlined from ‘v9fs_listxattr’ at fs/9p/xattr.c:142:9:
include/net/9p/9p.h:55:2: error: ‘%s’ directive argument is null
[-Werror=format-overflow=]
   55 |  _p9_debug(level, __func__, fmt, ##__VA_ARGS__)
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

use "" replace NULL to silence this warning.

Signed-off-by: Su Hui <suhui@nfschina.com>
---
 fs/9p/xattr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/9p/xattr.c b/fs/9p/xattr.c
index e00cf8109b3f..d995ee080835 100644
--- a/fs/9p/xattr.c
+++ b/fs/9p/xattr.c
@@ -139,7 +139,7 @@ int v9fs_fid_xattr_set(struct p9_fid *fid, const char *name,
 
 ssize_t v9fs_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size)
 {
-	return v9fs_xattr_get(dentry, NULL, buffer, buffer_size);
+	return v9fs_xattr_get(dentry, "", buffer, buffer_size);
 }
 
 static int v9fs_xattr_handler_get(const struct xattr_handler *handler,
-- 
2.30.2


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

end of thread, other threads:[~2023-10-10  8:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-08  6:01 [PATCH] fs/9p/xattr.c: avoid format-overflow warning Su Hui
2023-10-09 18:34 ` Christian Schoenebeck
2023-10-10  1:20   ` Su Hui
2023-10-10  2:23   ` asmadeus
2023-10-10  7:59     ` Christian Schoenebeck
2023-10-10  7:51 ` Dan Carpenter
2023-10-10  8:19   ` Su Hui

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