hwmon: (hwmon-vid) Add __maybe_unused attribute to dummy variable
Guenter Roeck
maintainerPATCH 1/1 hwmon: (hwmon-vid) Add __maybe_unused attribute to dummy variable
This gets rid of this warning:
drivers/hwmon/hwmon-vid.c: In function 'get_via_model_d_vrm':drivers/hwmon/hwmon-vid.c:249:27: warning: variable 'dummy' set but not used [-Wunused-but-set-variable]
--- drivers/hwmon/hwmon-vid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/hwmon-vid.c +1 -1
@@ -246,7 +246,7 @@ static struct vrm_model vrm_models[] = {*/ static u8 get_via_model_d_vrm (void ) { -unsigned int vid, brand, dummy; +unsigned int vid, brand,__maybe_unused dummy;static const char *brands[4 ] = {"C7-M" ,"C7" ,"Eden" ,"C7-D" };
Signature · 7 lines
1.7.9.7 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Guenter,
Quoted 5 lines · Guenter Roeck
This gets rid of this warning:
drivers/hwmon/hwmon-vid.c: In function 'get_via_model_d_vrm':drivers/hwmon/hwmon-vid.c:249:27: warning: variable 'dummy' set but not used [-Wunused-but-set-variable]
FWIW I no longer see this warning with gcc 4.7.2, but I remember seeing it before.
Quoted 10 lines
Signed-off-by Guenter Roeck <[email protected]>--- drivers/hwmon/hwmon-vid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hwmon/hwmon-vid.c +0
-0
drivers/hwmon/hwmon-vid.c static struct vrm_model vrm_models[] = { · line 252
Quoted 8 lines
drivers/hwmon/hwmon-vid.c +1
-1@@ -246,7 +246,7 @@ static struct vrm_model vrm_models[] = {*/ static u8 get_via_model_d_vrm (void ) { -unsigned int vid, brand, dummy; +unsigned int vid, brand,__maybe_unused dummy;static const char *brands[4 ] = {"C7-M" ,"C7" ,"Eden" ,"C7-D" };
Very nice, I didn't know about this attribute.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
maintainerQuoted 12 lines · Jean Delvare
Hi Guenter,
Quoted 5 lines · Guenter Roeck
This gets rid of this warning:
drivers/hwmon/hwmon-vid.c: In function 'get_via_model_d_vrm':drivers/hwmon/hwmon-vid.c:249:27: warning: variable 'dummy' set but not used [-Wunused-but-set-variable]FWIW I no longer see this warning with gcc 4.7.2, but I remember seeing it before.
I currently use 4.7.3. I think you may not see it anymore unless you build with W=1 (and/or C=1).
Quoted 21 lines
Quoted 10 lines
Signed-off-by Guenter Roeck <[email protected]>--- drivers/hwmon/hwmon-vid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hwmon/hwmon-vid.c +0
-0drivers/hwmon/hwmon-vid.c static struct vrm_model vrm_models[] = { · line 252
Quoted 8 lines
drivers/hwmon/hwmon-vid.c +1
-1@@ -246,7 +246,7 @@ static struct vrm_model vrm_models[] = {*/ static u8 get_via_model_d_vrm (void ) { -unsigned int vid, brand, dummy; +unsigned int vid, brand,__maybe_unused dummy;static const char *brands[4 ] = {"C7-M" ,"C7" ,"Eden" ,"C7-D" };Very nice, I didn't know about this attribute.
Quoted 2 lines
Reviewed-by Jean Delvare <[email protected]>
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors