Skip to contentSkip to conversation

linux-next: build warning after merge of the vfs tree

DISCUSSION Stephen Rothwell 3 participants 3 messages Jan 6, 2021 – Jan 7, 2021 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the vfs tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

In file included from fs/erofs/xattr.h:10,
from fs/erofs/namei.c:7:
fs/erofs/namei.c: In function 'erofs_lookup':
fs/erofs/internal.h:23:21: warning: format '%s' expects argument of type 'char *', but argument 4 has type 'struct dentry *' [-Wformat=]
23 | #define pr_fmt(fmt) "erofs: " fmt

      |                     ^~~~~~~~~
include/linux/dynamic_debug.h:129:15: note: in expansion of macro 'pr_fmt'
  129 |   func(&id, ##__VA_ARGS__);  \
      |               ^~~~~~~~~~~
include/linux/dynamic_debug.h:147:2: note: in expansion of macro '__dynamic_func_call'
  147 |  __dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
      |  ^~~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
  157 |  _dynamic_func_call(fmt, __dynamic_pr_debug,  \
      |  ^~~~~~~~~~~~~~~~~~
include/linux/printk.h:424:2: note: in expansion of macro 'dynamic_pr_debug'
  424 |  dynamic_pr_debug(fmt, ##__VA_ARGS__)
      |  ^~~~~~~~~~~~~~~~
fs/erofs/internal.h:34:33: note: in expansion of macro 'pr_debug'
   34 | #define erofs_dbg(x, ...)       pr_debug(x "\n", ##__VA_ARGS__)
      |                                 ^~~~~~~~
fs/erofs/namei.c:237:3: note: in expansion of macro 'erofs_dbg'
  237 |   erofs_dbg("%pd, %s (nid %llu) found, d_type %u", __func__,
      |   ^~~~~~~~~

Introduced by commit

879d4376533c ("erofs: use %pd instead of messing with ->d_name")

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw

Hi Al,

Quoted 21 lines · Stephen Rothwell

Hi all,

After merging the vfs tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

In file included from fs/erofs/xattr.h:10,
from fs/erofs/namei.c:7:
fs/erofs/namei.c: In function 'erofs_lookup':
fs/erofs/internal.h:23:21: warning: format '%s' expects argument of type 'char *', but argument 4 has type 'struct dentry *' [-Wformat=]
23 | #define pr_fmt(fmt) "erofs: " fmt

      |                     ^~~~~~~~~
include/linux/dynamic_debug.h:129:15: note: in expansion of macro 'pr_fmt'
  129 |   func(&id, ##__VA_ARGS__);  \
      |               ^~~~~~~~~~~
include/linux/dynamic_debug.h:147:2: note: in expansion of macro '__dynamic_func_call'
  147 |  __dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
      |  ^~~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
  157 |  _dynamic_func_call(fmt, __dynamic_pr_debug,  \
      |  ^~~~~~~~~~~~~~~~~~

include/linux/printk.h:424:2: note: in expansion of macro 'dynamic_pr_debug'

Quoted 8 lines
  424 |  dynamic_pr_debug(fmt, ##__VA_ARGS__)
      |  ^~~~~~~~~~~~~~~~
fs/erofs/internal.h:34:33: note: in expansion of macro 'pr_debug'
   34 | #define erofs_dbg(x, ...)       pr_debug(x "\n", ##__VA_ARGS__)
      |                                 ^~~~~~~~
fs/erofs/namei.c:237:3: note: in expansion of macro 'erofs_dbg'
  237 |   erofs_dbg("%pd, %s (nid %llu) found, d_type %u", __func__,
      |   ^~~~~~~~~

Thanks for modifying this. Use %pd is more reasonable than using d_name... It might be fixed as "%s, %pd (nid %llu) ...", thanks for this!

Thanks,
Gao Xiang

Quoted 8 lines

Introduced by commit

879d4376533c ("erofs: use %pd instead of messing with ->d_name")

Signature · 2 lines
Cheers,
Stephen Rothwell
#2 lore raw
In reply to Stephen Rothwell
Quoted 30 lines · Stephen Rothwell

Hi all,

After merging the vfs tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

In file included from fs/erofs/xattr.h:10,
from fs/erofs/namei.c:7:
fs/erofs/namei.c: In function 'erofs_lookup':
fs/erofs/internal.h:23:21: warning: format '%s' expects argument of type 'char *', but argument 4 has type 'struct dentry *' [-Wformat=]
23 | #define pr_fmt(fmt) "erofs: " fmt

      |                     ^~~~~~~~~
include/linux/dynamic_debug.h:129:15: note: in expansion of macro 'pr_fmt'
  129 |   func(&id, ##__VA_ARGS__);  \
      |               ^~~~~~~~~~~
include/linux/dynamic_debug.h:147:2: note: in expansion of macro '__dynamic_func_call'
  147 |  __dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
      |  ^~~~~~~~~~~~~~~~~~~
include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call'
  157 |  _dynamic_func_call(fmt, __dynamic_pr_debug,  \
      |  ^~~~~~~~~~~~~~~~~~
include/linux/printk.h:424:2: note: in expansion of macro 'dynamic_pr_debug'
  424 |  dynamic_pr_debug(fmt, ##__VA_ARGS__)
      |  ^~~~~~~~~~~~~~~~
fs/erofs/internal.h:34:33: note: in expansion of macro 'pr_debug'
   34 | #define erofs_dbg(x, ...)       pr_debug(x "\n", ##__VA_ARGS__)
      |                                 ^~~~~~~~
fs/erofs/namei.c:237:3: note: in expansion of macro 'erofs_dbg'
  237 |   erofs_dbg("%pd, %s (nid %llu) found, d_type %u", __func__,
      |   ^~~~~~~~~
Quoted 3 lines

Introduced by commit

879d4376533c ("erofs: use %pd instead of messing with ->d_name")

Gyah... "%s, %pd", not "%pd, %s". Sorry, fixed and pushed.