Skip to contentSkip to conversation

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

PATCH In review Anders Roxell 2 participants 3 messages Dec 1, 2020 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

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

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")
---
 drivers/hwmon/pwm-fan.c | 2 --
 1 file changed, 2 deletions(-)
drivers/hwmon/pwm-fan.c +0 -2
index 57b574837b58..777439f48c14 100644
@@ -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;
Signature · 1 line
2.29.2
maintainer
#1 lore raw
Quoted 10 lines · Anders Roxell

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

I already folded this change into the original patch.

Guenter

#2 lore raw
Quoted 8 lines · Guenter Roeck
Quoted 6 lines · Anders Roxell

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]

Quoted 6 lines
Quoted 4 lines

Remove the unneeded variable declaration 'ctx'.

Fixes 439ed83acc19 ("hwmon: (pwm-fan) Convert to hwmon_device_register_with_info API")

I already folded this change into the original patch.

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

Cheers,
Anders