* [PATCH] macintosh/ams: Fix unused variable warning
@ 2024-05-07 14:01 Michael Ellerman
2024-05-08 13:39 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Michael Ellerman @ 2024-05-07 14:01 UTC (permalink / raw)
To: linuxppc-dev
If both CONFIG_SENSORS_AMS_PMU and CONFIG_SENSORS_AMS_I2C are unset,
there is an unused variable warning in the ams driver:
drivers/macintosh/ams/ams-core.c: In function 'ams_init':
drivers/macintosh/ams/ams-core.c:181:29: warning: unused variable 'np'
181 | struct device_node *np;
The driver needs at least one of the configs enabled in order to
actually function. So fix the compiler warning by ensuring at least one
of the configs is enabled.
Suggested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
drivers/macintosh/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig
index a0e717a986dc..fb38f684444f 100644
--- a/drivers/macintosh/Kconfig
+++ b/drivers/macintosh/Kconfig
@@ -262,7 +262,7 @@ config SENSORS_AMS
will be called ams.
config SENSORS_AMS_PMU
- bool "PMU variant"
+ bool "PMU variant" if SENSORS_AMS_I2C
depends on SENSORS_AMS && ADB_PMU
default y
help
--
2.45.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] macintosh/ams: Fix unused variable warning
2024-05-07 14:01 [PATCH] macintosh/ams: Fix unused variable warning Michael Ellerman
@ 2024-05-08 13:39 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2024-05-08 13:39 UTC (permalink / raw)
To: linuxppc-dev, Michael Ellerman
On Wed, 08 May 2024 00:01:50 +1000, Michael Ellerman wrote:
> If both CONFIG_SENSORS_AMS_PMU and CONFIG_SENSORS_AMS_I2C are unset,
> there is an unused variable warning in the ams driver:
>
> drivers/macintosh/ams/ams-core.c: In function 'ams_init':
> drivers/macintosh/ams/ams-core.c:181:29: warning: unused variable 'np'
> 181 | struct device_node *np;
>
> [...]
Applied to powerpc/next.
[1/1] macintosh/ams: Fix unused variable warning
https://git.kernel.org/powerpc/c/bc8744c6bf0d487dcb7911d093fce60a62cc2654
cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-05-08 13:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-07 14:01 [PATCH] macintosh/ams: Fix unused variable warning Michael Ellerman
2024-05-08 13:39 ` Michael Ellerman
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).