Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

time/debug: Remove dentry pointer for debugfs

There is no need to keep the dentry pointer around for the created
debugfs file, as it is only needed when removing it from the system.
When it is to be removed, ask debugfs itself for the pointer, to save on
storage and make things a bit simpler.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210216155020.1012407-1-gregkh@linuxfoundation.org

authored by

Greg Kroah-Hartman and committed by
Thomas Gleixner
44511ab3 1e28eed1

+3 -4
+3 -4
kernel/time/test_udelay.c
··· 21 21 #define DEBUGFS_FILENAME "udelay_test" 22 22 23 23 static DEFINE_MUTEX(udelay_test_lock); 24 - static struct dentry *udelay_test_debugfs_file; 25 24 static int udelay_test_usecs; 26 25 static int udelay_test_iterations = DEFAULT_ITERATIONS; 27 26 ··· 137 138 static int __init udelay_test_init(void) 138 139 { 139 140 mutex_lock(&udelay_test_lock); 140 - udelay_test_debugfs_file = debugfs_create_file(DEBUGFS_FILENAME, 141 - S_IRUSR, NULL, NULL, &udelay_test_debugfs_ops); 141 + debugfs_create_file(DEBUGFS_FILENAME, S_IRUSR, NULL, NULL, 142 + &udelay_test_debugfs_ops); 142 143 mutex_unlock(&udelay_test_lock); 143 144 144 145 return 0; ··· 149 150 static void __exit udelay_test_exit(void) 150 151 { 151 152 mutex_lock(&udelay_test_lock); 152 - debugfs_remove(udelay_test_debugfs_file); 153 + debugfs_remove(debugfs_lookup(DEBUGFS_FILENAME, NULL)); 153 154 mutex_unlock(&udelay_test_lock); 154 155 } 155 156