linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hwmon: dell-smm-hwmon: fix unused variable error
@ 2021-09-10  7:19 Randy Dunlap
  2021-09-10 15:34 ` Guenter Roeck
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Randy Dunlap @ 2021-09-10  7:19 UTC (permalink / raw)
  Cc: Randy Dunlap, Pali Rohár, Jean Delvare, Guenter Roeck,
	linux-hwmon, Greg Kroah-Hartman, Arnd Bergmann, x86, Armin Wolf

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] hwmon: dell-smm-hwmon: fix unused variable error
  2021-09-10  7:19 [PATCH] hwmon: dell-smm-hwmon: fix unused variable error Randy Dunlap
@ 2021-09-10 15:34 ` Guenter Roeck
  2021-09-10 23:14 ` Pali Rohár
  2021-09-20 17:57 ` Arnd Bergmann
  2 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2021-09-10 15:34 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Pali Rohár, Jean Delvare, linux-hwmon, Greg Kroah-Hartman,
	Arnd Bergmann, x86, Armin Wolf

On 9/10/21 12:19 AM, Randy Dunlap wrote:
> 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>

Acked-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   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
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] hwmon: dell-smm-hwmon: fix unused variable error
  2021-09-10  7:19 [PATCH] hwmon: dell-smm-hwmon: fix unused variable error Randy Dunlap
  2021-09-10 15:34 ` Guenter Roeck
@ 2021-09-10 23:14 ` Pali Rohár
  2021-09-20 17:57 ` Arnd Bergmann
  2 siblings, 0 replies; 4+ messages in thread
From: Pali Rohár @ 2021-09-10 23:14 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Jean Delvare, Guenter Roeck, linux-hwmon, Greg Kroah-Hartman,
	Arnd Bergmann, x86, Armin Wolf

On Friday 10 September 2021 00:19:21 Randy Dunlap wrote:
> 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>

Acked-by: 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] hwmon: dell-smm-hwmon: fix unused variable error
  2021-09-10  7:19 [PATCH] hwmon: dell-smm-hwmon: fix unused variable error Randy Dunlap
  2021-09-10 15:34 ` Guenter Roeck
  2021-09-10 23:14 ` Pali Rohár
@ 2021-09-20 17:57 ` Arnd Bergmann
  2 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2021-09-20 17:57 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Pali Rohár, Jean Delvare, Guenter Roeck, linux-hwmon,
	Greg Kroah-Hartman, Arnd Bergmann, the arch/x86 maintainers,
	Armin Wolf

On Fri, Sep 10, 2021 at 9:19 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> 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>

I submitted a different patch today after noticing the same issue but
your patch is better:

Reported-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>

      Arnd

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-20 17:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-10  7:19 [PATCH] hwmon: dell-smm-hwmon: fix unused variable error Randy Dunlap
2021-09-10 15:34 ` Guenter Roeck
2021-09-10 23:14 ` Pali Rohár
2021-09-20 17:57 ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).