All of lore.kernel.org
 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
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ 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] 6+ 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
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ 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] 6+ 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 subsequent siblings)
  4 siblings, 0 replies; 6+ 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] 6+ 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
  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
  4 siblings, 0 replies; 6+ 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] 6+ messages in thread

* [tip: x86/misc] x86/Kconfig: Fix an unused variable error in dell-smm-hwmon
  2021-09-10  7:19 [PATCH] hwmon: dell-smm-hwmon: fix unused variable error Randy Dunlap
                   ` (2 preceding siblings ...)
  2021-09-20 17:57 ` Arnd Bergmann
@ 2021-09-22 17:19 ` tip-bot2 for Randy Dunlap
  2021-10-04  9:48 ` tip-bot2 for Randy Dunlap
  4 siblings, 0 replies; 6+ messages in thread
From: tip-bot2 for Randy Dunlap @ 2021-09-22 17:19 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Arnd Bergmann, Randy Dunlap, Borislav Petkov, Guenter Roeck,
	pali, x86, linux-kernel

The following commit has been merged into the x86/misc branch of tip:

Commit-ID:     64c76a84337a5678009155fafe98c5cd8ec673f0
Gitweb:        https://git.kernel.org/tip/64c76a84337a5678009155fafe98c5cd8ec673f0
Author:        Randy Dunlap <rdunlap@infradead.org>
AuthorDate:    Fri, 10 Sep 2021 00:19:21 -07:00
Committer:     Borislav Petkov <bp@suse.de>
CommitterDate: Wed, 22 Sep 2021 19:09:56 +02:00

x86/Kconfig: Fix an unused variable error in dell-smm-hwmon

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

Make I8K depend on PROC_FS and HWMON (instead of selecting HWMON -- it
is strongly preferred to not 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")
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Pali Rohár <pali@kernel.org>
Link: https://lkml.kernel.org/r/20210910071921.16777-1-rdunlap@infradead.org
---
 arch/x86/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index dad7f85..e5ba8af 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1256,7 +1256,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] 6+ messages in thread

* [tip: x86/misc] x86/Kconfig: Fix an unused variable error in dell-smm-hwmon
  2021-09-10  7:19 [PATCH] hwmon: dell-smm-hwmon: fix unused variable error Randy Dunlap
                   ` (3 preceding siblings ...)
  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
  4 siblings, 0 replies; 6+ messages in thread
From: tip-bot2 for Randy Dunlap @ 2021-10-04  9:48 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Arnd Bergmann, Randy Dunlap, Borislav Petkov, Guenter Roeck,
	pali, x86, linux-kernel

The following commit has been merged into the x86/misc branch of tip:

Commit-ID:     ef775a0e36c6a81c5b07cb228c02f967133fe768
Gitweb:        https://git.kernel.org/tip/ef775a0e36c6a81c5b07cb228c02f967133fe768
Author:        Randy Dunlap <rdunlap@infradead.org>
AuthorDate:    Fri, 10 Sep 2021 00:19:21 -07:00
Committer:     Borislav Petkov <bp@suse.de>
CommitterDate: Mon, 04 Oct 2021 11:11:48 +02:00

x86/Kconfig: Fix an unused variable error in dell-smm-hwmon

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

Make I8K depend on PROC_FS and HWMON (instead of selecting HWMON -- it
is strongly preferred to not 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")
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Pali Rohár <pali@kernel.org>
Link: https://lkml.kernel.org/r/20210910071921.16777-1-rdunlap@infradead.org
---
 arch/x86/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index ab83c22..16e216b 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1256,7 +1256,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] 6+ messages in thread

end of thread, other threads:[~2021-10-04  9:48 UTC | newest]

Thread overview: 6+ 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
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

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.