Skip to contentSkip to conversation

hwmon: (emc6w201): Do not declare enum variable

PATCH In review Guenter Roeck 2 participants 3 messages Aug 4, 2013 – Aug 22, 2013 Hardware monitoring

lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH 1/1 hwmon: (emc6w201): Do not declare enum variable

Fix the following smatch warning:

emc6w201.c:52:26: warning: symbol 'subfeature' was not declared. Should it be static?

'enum { } subtype' declares an enum as (global) variable which we don't want.

---
 drivers/hwmon/emc6w201.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/emc6w201.c +1 -1
index 936898f..82e661e 100644
@@ -49,7 +49,7 @@ static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };
 #define EMC6W201_REG_TEMP_HIGH(nr)	(0x57 + (nr) * 2)
 #define EMC6W201_REG_FAN_MIN(nr)	(0x62 + (nr) * 2)
 
-enum { input, min, max } subfeature;
+enum subfeature { input, min, max };
 
 /*
  * Per-device data
Signature · 7 lines
1.7.9.7


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#1 lore raw
Quoted 17 lines · Guenter Roeck

Fix the following smatch warning:

emc6w201.c:52:26: warning: symbol 'subfeature' was not declared. Should it be static?

'enum { } subtype' declares an enum as (global) variable which we don't want.

---
 drivers/hwmon/emc6w201.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/emc6w201.c +0 -0
index 936898f..82e661e 100644

drivers/hwmon/emc6w201.c static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; · line 55

Quoted 8 lines
drivers/hwmon/emc6w201.c +1 -1
@@ -49,7 +49,7 @@ static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };
 #define EMC6W201_REG_TEMP_HIGH(nr)	(0x57 + (nr) * 2)
 #define EMC6W201_REG_FAN_MIN(nr)	(0x62 + (nr) * 2)
 
-enum { input, min, max } subfeature;
+enum subfeature { input, min, max };
 
 /*
  * Per-device data

Good catch. Applied, thanks.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
author maintainer
#2 lore raw
In reply to Guenter Roeck
Quoted 21 lines · Jean Delvare
Quoted 20 lines · Guenter Roeck

Fix the following smatch warning:

emc6w201.c:52:26: warning: symbol 'subfeature' was not declared. Should it be static?

'enum { } subtype' declares an enum as (global) variable which we don't want.

---
 drivers/hwmon/emc6w201.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/emc6w201.c +0 -0
index 936898f..82e661e 100644
@@ -49,7 +49,7 @@ static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };
 #define EMC6W201_REG_TEMP_HIGH(nr)	(0x57 + (nr) * 2)
 #define EMC6W201_REG_FAN_MIN(nr)	(0x62 + (nr) * 2)
 
Quoted 8 lines

drivers/hwmon/emc6w201.c static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; · line 55

Quoted 5 lines
drivers/hwmon/emc6w201.c +1 -1
-enum { input, min, max } subfeature;
+enum subfeature { input, min, max };
 
 /*
  * Per-device data

Good catch. Applied, thanks.

Ok, I'll drop it from my queue.

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors