diff mbox series

drivers: hwmon: pwm-fan: fix warning unused variable 'ctx'

Message ID 20201201003118.2219422-1-anders.roxell@linaro.org (mailing list archive)
State Not Applicable
Headers show
Series drivers: hwmon: pwm-fan: fix warning unused variable 'ctx' | expand

Commit Message

Anders Roxell Dec. 1, 2020, 12:31 a.m. UTC
When building hwmon/pwm-fan the following unused-variable warning shows
up:

/tmp/drivers/hwmon/pwm-fan.c: In function ‘pwm_fan_is_visible’:
/tmp/drivers/hwmon/pwm-fan.c:167:22: warning: unused variable ‘ctx’ [-Wunused-variable]

Remove the unneeded variable declaration 'ctx'.

Fixes: 439ed83acc19 ("hwmon: (pwm-fan) Convert to hwmon_device_register_with_info API")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 drivers/hwmon/pwm-fan.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Guenter Roeck Dec. 1, 2020, 12:49 a.m. UTC | #1
On Tue, Dec 01, 2020 at 01:31:18AM +0100, Anders Roxell wrote:
> When building hwmon/pwm-fan the following unused-variable warning shows
> up:
> 
> /tmp/drivers/hwmon/pwm-fan.c: In function ‘pwm_fan_is_visible’:
> /tmp/drivers/hwmon/pwm-fan.c:167:22: warning: unused variable ‘ctx’ [-Wunused-variable]
> 
> Remove the unneeded variable declaration 'ctx'.
> 
> Fixes: 439ed83acc19 ("hwmon: (pwm-fan) Convert to hwmon_device_register_with_info API")
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>

I already folded this change into the original patch.

Guenter
Anders Roxell Dec. 1, 2020, 12:52 a.m. UTC | #2
On Tue, 1 Dec 2020 at 01:49, Guenter Roeck <linux@roeck-us.net> wrote:
>
> On Tue, Dec 01, 2020 at 01:31:18AM +0100, Anders Roxell wrote:
> > When building hwmon/pwm-fan the following unused-variable warning shows
> > up:
> >
> > /tmp/drivers/hwmon/pwm-fan.c: In function ‘pwm_fan_is_visible’:
> > /tmp/drivers/hwmon/pwm-fan.c:167:22: warning: unused variable ‘ctx’ [-Wunused-variable]
> >
> > Remove the unneeded variable declaration 'ctx'.
> >
> > Fixes: 439ed83acc19 ("hwmon: (pwm-fan) Convert to hwmon_device_register_with_info API")
> > Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
>
> I already folded this change into the original patch.

That's great Guenter, I missed that. I'm sorry for the noise.

Cheers,
Anders
diff mbox series

Patch

diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c
index 57b574837b58..777439f48c14 100644
--- a/drivers/hwmon/pwm-fan.c
+++ b/drivers/hwmon/pwm-fan.c
@@ -164,8 +164,6 @@  static umode_t pwm_fan_is_visible(const void *data,
 				  enum hwmon_sensor_types type,
 				  u32 attr, int channel)
 {
-	struct pwm_fan_ctx *ctx = (struct pwm_fan_ctx *)data;
-
 	switch (type) {
 	case hwmon_pwm:
 		return 0644;