Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751693AbcCFT7p (ORCPT ); Sun, 6 Mar 2016 14:59:45 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:36152 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751371AbcCFT7e (ORCPT ); Sun, 6 Mar 2016 14:59:34 -0500 From: Nicolai Stange To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Nicolai Stange Subject: [PATCH 2/2] debugfs: inline dummy implementations of debugfs_use_file_start()/_finish() Date: Sun, 6 Mar 2016 20:59:05 +0100 Message-Id: <1457294345-4588-3-git-send-email-nicstange@gmail.com> X-Mailer: git-send-email 2.7.2 In-Reply-To: <1457294345-4588-1-git-send-email-nicstange@gmail.com> References: <1457294345-4588-1-git-send-email-nicstange@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1942 Lines: 53 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 --- 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