All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: unlisted-recipients:; (no To-header on input)
Cc: "Randy Dunlap" <rdunlap@infradead.org>,
	"Pali Rohár" <pali@kernel.org>,
	"Jean Delvare" <jdelvare@suse.com>,
	"Guenter Roeck" <linux@roeck-us.net>,
	linux-hwmon@vger.kernel.org,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Arnd Bergmann" <arnd@arndb.de>,
	x86@kernel.org, "Armin Wolf" <W_Armin@gmx.de>
Subject: [PATCH] hwmon: dell-smm-hwmon: fix unused variable error
Date: Fri, 10 Sep 2021 00:19:21 -0700	[thread overview]
Message-ID: <20210910071921.16777-1-rdunlap@infradead.org> (raw)

When CONFIG_PROC_FS is not set, there is a build warning (turned
into an error):

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

Fix this by making I8K depend on PROC_FS and HWMON (instead of
selecting HWMON -- we prefer and try hard not to select entire
subsystems).

Build tested in all possible combinations of SENSORS_DELL_SMM,
I8K, and PROC_FS.

Fixes: 039ae58503f3 ("hwmon: Allow to compile dell-smm-hwmon driver without /proc/i8k")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Pali Rohár <pali@kernel.org>
Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: x86@kernel.org
Cc: Armin Wolf <W_Armin@gmx.de>
---
 arch/x86/Kconfig |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- linux-next-20210910.orig/arch/x86/Kconfig
+++ linux-next-20210910/arch/x86/Kconfig
@@ -1255,7 +1255,8 @@ config TOSHIBA
 
 config I8K
 	tristate "Dell i8k legacy laptop support"
-	select HWMON
+	depends on HWMON
+	depends on PROC_FS
 	select SENSORS_DELL_SMM
 	help
 	  This option enables legacy /proc/i8k userspace interface in hwmon

             reply	other threads:[~2021-09-10  7:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10  7:19 Randy Dunlap [this message]
2021-09-10 15:34 ` [PATCH] hwmon: dell-smm-hwmon: fix unused variable error Guenter Roeck
2021-09-10 23:14 ` Pali Rohár
2021-09-20 17:57 ` Arnd Bergmann
2021-09-22 17:19 ` [tip: x86/misc] x86/Kconfig: Fix an unused variable error in dell-smm-hwmon tip-bot2 for Randy Dunlap
2021-10-04  9:48 ` tip-bot2 for Randy Dunlap

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=20210910071921.16777-1-rdunlap@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=W_Armin@gmx.de \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=pali@kernel.org \
    --cc=x86@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.