lkml.org 
[lkml]   [2021]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] hwmon: dell-smm-hwmon: remove unused variable warning
Date
From: Arnd Bergmann <arnd@arndb.de>

When procfs is disabled, the code produces a warning
for an unused variable:

drivers/hwmon/dell-smm-hwmon.c: In function 'i8k_init_procfs':
drivers/hwmon/dell-smm-hwmon.c:624:31: error: unused variable 'data' [-Werror=unused-variable]
624 | struct dell_smm_data *data = dev_get_drvdata(dev);
| ^~~~

Remove that local variable and just pass dev_get_drvdata(dev)
directly.

Fixes: ba04d73c26ed ("hwmon: (dell-smm-hwmon) Move variables into a driver private data structure")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/hwmon/dell-smm-hwmon.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
index 774c1b0715d9..0a3ce22c78e6 100644
--- a/drivers/hwmon/dell-smm-hwmon.c
+++ b/drivers/hwmon/dell-smm-hwmon.c
@@ -621,10 +621,8 @@ static void i8k_exit_procfs(void *param)

static void __init i8k_init_procfs(struct device *dev)
{
- struct dell_smm_data *data = dev_get_drvdata(dev);
-
/* Register the proc entry */
- proc_create_data("i8k", 0, NULL, &i8k_proc_ops, data);
+ proc_create_data("i8k", 0, NULL, &i8k_proc_ops, dev_get_drvdata(dev));

devm_add_action_or_reset(dev, i8k_exit_procfs, NULL);
}
--
2.29.2
\
 
 \ /
  Last update: 2021-09-20 14:16    [W:0.055 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site