Skip to content

Commit 4250b04

Browse files
k7k7gregkh
authored andcommitted
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: Kusanagi Kouichi <[email protected]> Link: https://lore.kernel.org/r/20191121102021787.MLMY.25002.ppp.dion.ne.jp@dmta0003.auone-net.jp Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e149573 commit 4250b04

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

include/linux/debugfs.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ static const struct file_operations __fops = { \
5454
.llseek = no_llseek, \
5555
}
5656

57+
typedef struct vfsmount *(*debugfs_automount_t)(struct dentry *, void *);
58+
5759
#if defined(CONFIG_DEBUG_FS)
5860

5961
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);
7577
struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent,
7678
const char *dest);
7779

78-
typedef struct vfsmount *(*debugfs_automount_t)(struct dentry *, void *);
7980
struct dentry *debugfs_create_automount(const char *name,
8081
struct dentry *parent,
8182
debugfs_automount_t f,
@@ -203,7 +204,7 @@ static inline struct dentry *debugfs_create_symlink(const char *name,
203204

204205
static inline struct dentry *debugfs_create_automount(const char *name,
205206
struct dentry *parent,
206-
struct vfsmount *(*f)(void *),
207+
debugfs_automount_t f,
207208
void *data)
208209
{
209210
return ERR_PTR(-ENODEV);

0 commit comments

Comments
 (0)