mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolai Stange <nicstange@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, Nicolai Stange <nicstange@gmail.com>
Subject: [PATCH 2/2] debugfs: inline dummy implementations of debugfs_use_file_start()/_finish()
Date: Sun,  6 Mar 2016 20:59:05 +0100	[thread overview]
Message-ID: <1457294345-4588-3-git-send-email-nicstange@gmail.com> (raw)
In-Reply-To: <1457294345-4588-1-git-send-email-nicstange@gmail.com>

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@gmail.com>
---
 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

  parent reply	other threads:[~2016-03-06 19:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-06 19:59 [PATCH 0/2] debugfs: fixup to file removal protection series Nicolai Stange
2016-03-06 19:59 ` [PATCH 1/2] debugfs: fix DocBook comment of debugfs_use_file_start() Nicolai Stange
2016-03-06 19:59 ` Nicolai Stange [this message]
2016-03-22 13:17 ` [PATCH 0/2] debugfs: fixup to file removal protection series Nicolai Stange

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1457294345-4588-3-git-send-email-nicstange@gmail.com \
    --to=nicstange@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome