[PATCH 2/2] debugfs: inline dummy implementations of debugfs_use_file_start()/_finish()

From: Nicolai Stange
Date: Sun Mar 06 2016 - 14:59:48 EST


In commit 921d5cbeb37c ("debugfs: prevent access to removed files'
private data")
the functions debugfs_use_file_start() and debugfs_use_file_finish() have
been exported from the debugfs core.

Unfortunately, the inline keyword has been missed at their noop
implementations provided for the CONFIG_DEBUG_FS=n case.

Due to this lapse, the kbuild test robot moans on a powerpc defconfig
build:

In file included from arch/powerpc/kernel/irq.c:54:0:
include/linux/debugfs.h:185:12: error: 'debugfs_use_file_start'
defined but not used [-Werror=unused-function]
static int debugfs_use_file_start(const struct dentry *dentry,
int *srcu_idx)

include/linux/debugfs.h:191:13: error: 'debugfs_use_file_finish'
defined but not used [-Werror=unused-function]
static void debugfs_use_file_finish(int srcu_idx)

Add the inline keyword to the CONFIG_DEBUG_FS=n noop implementations of
debugfs_use_file_start() and debugfs_use_file_finish().

Signed-off-by: Nicolai Stange <nicstange@xxxxxxxxx>
---
include/linux/debugfs.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index e7d2a99..1438e23 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -205,13 +205,15 @@ static inline void debugfs_remove(struct dentry *dentry)
static inline void debugfs_remove_recursive(struct dentry *dentry)
{ }

-static int debugfs_use_file_start(const struct dentry *dentry, int *srcu_idx)
+static inline int debugfs_use_file_start(const struct dentry *dentry,
+ int *srcu_idx)
__acquires(&debugfs_srcu)
{
return 0;
}

-static void debugfs_use_file_finish(int srcu_idx) __releases(&debugfs_srcu)
+static inline void debugfs_use_file_finish(int srcu_idx)
+ __releases(&debugfs_srcu)
{ }

#define DEFINE_DEBUGFS_ATTRIBUTE(__fops, __get, __set, __fmt) \
--
2.7.2