Commit 4250b047 authored by Kusanagi Kouichi's avatar Kusanagi Kouichi Committed by Greg Kroah-Hartman

debugfs: Fix !DEBUG_FS debugfs_create_automount

If DEBUG_FS=n, compile fails with the following error:

kernel/trace/trace.c: In function 'tracing_init_dentry':
kernel/trace/trace.c:8658:9: error: passing argument 3 of 'debugfs_create_automount' from incompatible pointer type [-Werror=incompatible-pointer-types]
 8658 |         trace_automount, NULL);
      |         ^~~~~~~~~~~~~~~
      |         |
      |         struct vfsmount * (*)(struct dentry *, void *)
In file included from kernel/trace/trace.c:24:
./include/linux/debugfs.h:206:25: note: expected 'struct vfsmount * (*)(void *)' but argument is of type 'struct vfsmount * (*)(struct dentry *, void *)'
  206 |      struct vfsmount *(*f)(void *),
      |      ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
Signed-off-by: default avatarKusanagi Kouichi <slash@ac.auone-net.jp>
Link: https://lore.kernel.org/r/20191121102021787.MLMY.25002.ppp.dion.ne.jp@dmta0003.auone-net.jpSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e149573b
...@@ -54,6 +54,8 @@ static const struct file_operations __fops = { \ ...@@ -54,6 +54,8 @@ static const struct file_operations __fops = { \
.llseek = no_llseek, \ .llseek = no_llseek, \
} }
typedef struct vfsmount *(*debugfs_automount_t)(struct dentry *, void *);
#if defined(CONFIG_DEBUG_FS) #if defined(CONFIG_DEBUG_FS)
struct dentry *debugfs_lookup(const char *name, struct dentry *parent); struct dentry *debugfs_lookup(const char *name, struct dentry *parent);
...@@ -75,7 +77,6 @@ struct dentry *debugfs_create_dir(const char *name, struct dentry *parent); ...@@ -75,7 +77,6 @@ struct dentry *debugfs_create_dir(const char *name, struct dentry *parent);
struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent, struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent,
const char *dest); const char *dest);
typedef struct vfsmount *(*debugfs_automount_t)(struct dentry *, void *);
struct dentry *debugfs_create_automount(const char *name, struct dentry *debugfs_create_automount(const char *name,
struct dentry *parent, struct dentry *parent,
debugfs_automount_t f, debugfs_automount_t f,
...@@ -203,7 +204,7 @@ static inline struct dentry *debugfs_create_symlink(const char *name, ...@@ -203,7 +204,7 @@ static inline struct dentry *debugfs_create_symlink(const char *name,
static inline struct dentry *debugfs_create_automount(const char *name, static inline struct dentry *debugfs_create_automount(const char *name,
struct dentry *parent, struct dentry *parent,
struct vfsmount *(*f)(void *), debugfs_automount_t f,
void *data) void *data)
{ {
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment