public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: "Pali Rohár" <pali@kernel.org>,
	"Jean Delvare" <jdelvare@suse.com>,
	"Guenter Roeck" <linux@roeck-us.net>,
	"Armin Wolf" <W_Armin@gmx.de>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Carlos Alberto Lopez Perez <clopez@igalia.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Sebastian Oechsle <setboolean@icloud.com>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] hwmon: dell-smm-hwmon: remove unused variable warning
Date: Mon, 20 Sep 2021 14:14:16 +0200	[thread overview]
Message-ID: <20210920121421.93297-1-arnd@kernel.org> (raw)

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


             reply	other threads:[~2021-09-20 12:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-20 12:14 Arnd Bergmann [this message]
2021-09-20 12:31 ` [PATCH] hwmon: dell-smm-hwmon: remove unused variable warning Pali Rohár
2021-09-20 13:14   ` Arnd Bergmann
2021-09-20 14:19     ` Guenter Roeck
2021-09-20 22:19 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210920121421.93297-1-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=W_Armin@gmx.de \
    --cc=arnd@arndb.de \
    --cc=bigeasy@linutronix.de \
    --cc=clopez@igalia.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=pali@kernel.org \
    --cc=setboolean@icloud.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox