genirq/debugfs: Remove pointless NULL pointer check
authorThomas Gleixner <tglx@linutronix.de>
Sat, 24 Jun 2017 09:05:59 +0000 (11:05 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 24 Jun 2017 09:43:53 +0000 (11:43 +0200)
debugfs_remove() has it's own NULL pointer check. Remove the conditional
and make irq_remove_debugfs_entry() an inline helper

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/irq/debugfs.c
kernel/irq/internals.h

index dbd6e78db2131edaf85d3e39ad807b2ed4daf1c6..4d384edc0c64eb1807cf3f8056c2607c58053ab1 100644 (file)
@@ -3,7 +3,6 @@
  *
  * This file is licensed under the GPL V2.
  */
-#include <linux/debugfs.h>
 #include <linux/irqdomain.h>
 #include <linux/irq.h>
 
@@ -191,12 +190,6 @@ void irq_add_debugfs_entry(unsigned int irq, struct irq_desc *desc)
                                                 &dfs_irq_ops);
 }
 
-void irq_remove_debugfs_entry(struct irq_desc *desc)
-{
-       if (desc->debugfs_file)
-               debugfs_remove(desc->debugfs_file);
-}
-
 static int __init irq_debugfs_init(void)
 {
        struct dentry *root_dir;
index 5fd105e252c3bc239fa7609df2ddf27cb59a0146..a573e0771baf7f390dd564e1b0f8c2373089fa39 100644 (file)
@@ -318,8 +318,13 @@ static inline bool irq_fixup_move_pending(struct irq_desc *desc, bool fclear)
 #endif /* !CONFIG_GENERIC_PENDING_IRQ */
 
 #ifdef CONFIG_GENERIC_IRQ_DEBUGFS
+#include <linux/debugfs.h>
+
 void irq_add_debugfs_entry(unsigned int irq, struct irq_desc *desc);
-void irq_remove_debugfs_entry(struct irq_desc *desc);
+static inline void irq_remove_debugfs_entry(struct irq_desc *desc)
+{
+       debugfs_remove(desc->debugfs_file);
+}
 # ifdef CONFIG_IRQ_DOMAIN
 void irq_domain_debugfs_init(struct dentry *root);
 # else