Skip to contentSkip to conversation

drivers: base: power: remove wakeup_sources_stats_dentry variable

PATCH Applied Greg Kroah-Hartman 2 participants 2 messages Jun 18, 2019 – Jun 19, 2019

Subsystems (4)
lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

PATCH 1/1 drivers: base: power: remove wakeup_sources_stats_dentry variable

wakeup_sources_stats_dentry is assigned when the debugfs file is created, but then never used ever again. So no need for it at all, just remove it and call debugfs_create_file() on its own.

Cc "Rafael J. Wysocki" <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Len Brown <[email protected]>
---
 drivers/base/power/wakeup.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/base/power/wakeup.c +2 -4
index 5b2b6a05a4f3..ee31d4f8d856 100644
@@ -968,8 +968,6 @@ void pm_wakep_autosleep_enabled(bool set)
 }
 #endif /* CONFIG_PM_AUTOSLEEP */
 
-static struct dentry *wakeup_sources_stats_dentry;
-
 /**
  * print_wakeup_source_stats - Print wakeup source statistics information.
  * @m: seq_file to print the statistics into.
@@ -1099,8 +1097,8 @@ static const struct file_operations wakeup_sources_stats_fops = {
 
 static int __init wakeup_sources_debugfs_init(void)
 {
-	wakeup_sources_stats_dentry = debugfs_create_file("wakeup_sources",
-			S_IRUGO, NULL, NULL, &wakeup_sources_stats_fops);
+	debugfs_create_file("wakeup_sources", S_IRUGO, NULL, NULL,
+			    &wakeup_sources_stats_fops);
 	return 0;
 }
 
Signature · 1 line
2.22.0
#1 lore raw
Quoted 28 lines · CEST Greg Kroah-Hartman

wakeup_sources_stats_dentry is assigned when the debugfs file is created, but then never used ever again. So no need for it at all, just remove it and call debugfs_create_file() on its own.

Cc "Rafael J. Wysocki" <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Len Brown <[email protected]>
---
 drivers/base/power/wakeup.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/base/power/wakeup.c +0 -2
index 5b2b6a05a4f3..ee31d4f8d856 100644
@@ -968,8 +968,6 @@ void pm_wakep_autosleep_enabled(bool set)
 }
 #endif /* CONFIG_PM_AUTOSLEEP */
 
-static struct dentry *wakeup_sources_stats_dentry;
-
 /**
  * print_wakeup_source_stats - Print wakeup source statistics information.
  * @m: seq_file to print the statistics into.

drivers/base/power/wakeup.c static const struct file_operations wakeup_sources_stats_fops = { · line 1104

Quoted 10 lines
drivers/base/power/wakeup.c +2 -2
@@ -1099,8 +1097,8 @@ static const struct file_operations wakeup_sources_stats_fops = {
 
 static int __init wakeup_sources_debugfs_init(void)
 {
-	wakeup_sources_stats_dentry = debugfs_create_file("wakeup_sources",
-			S_IRUGO, NULL, NULL, &wakeup_sources_stats_fops);
+	debugfs_create_file("wakeup_sources", S_IRUGO, NULL, NULL,
+			    &wakeup_sources_stats_fops);
 	return 0;
 }
 

Queued for 5.3, thanks!