Skip to content

Commit c2ce34c

Browse files
committed
genirq/debugfs: Remove pointless NULL pointer check
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 <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
1 parent 8d9d51b commit c2ce34c

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

kernel/irq/debugfs.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
*
44
* This file is licensed under the GPL V2.
55
*/
6-
#include <linux/debugfs.h>
76
#include <linux/irqdomain.h>
87
#include <linux/irq.h>
98

@@ -191,12 +190,6 @@ void irq_add_debugfs_entry(unsigned int irq, struct irq_desc *desc)
191190
&dfs_irq_ops);
192191
}
193192

194-
void irq_remove_debugfs_entry(struct irq_desc *desc)
195-
{
196-
if (desc->debugfs_file)
197-
debugfs_remove(desc->debugfs_file);
198-
}
199-
200193
static int __init irq_debugfs_init(void)
201194
{
202195
struct dentry *root_dir;

kernel/irq/internals.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,13 @@ static inline bool irq_fixup_move_pending(struct irq_desc *desc, bool fclear)
318318
#endif /* !CONFIG_GENERIC_PENDING_IRQ */
319319

320320
#ifdef CONFIG_GENERIC_IRQ_DEBUGFS
321+
#include <linux/debugfs.h>
322+
321323
void irq_add_debugfs_entry(unsigned int irq, struct irq_desc *desc);
322-
void irq_remove_debugfs_entry(struct irq_desc *desc);
324+
static inline void irq_remove_debugfs_entry(struct irq_desc *desc)
325+
{
326+
debugfs_remove(desc->debugfs_file);
327+
}
323328
# ifdef CONFIG_IRQ_DOMAIN
324329
void irq_domain_debugfs_init(struct dentry *root);
325330
# else

0 commit comments

Comments
 (0)