* [lm-sensors] [PATCH] hwmon: (hwmon-vid) Add __maybe_unused attribute to dummy variable
@ 2013-09-09 10:53 Guenter Roeck
2013-09-10 7:37 ` Jean Delvare
2013-09-10 13:27 ` Guenter Roeck
0 siblings, 2 replies; 3+ messages in thread
From: Guenter Roeck @ 2013-09-09 10:53 UTC (permalink / raw)
To: lm-sensors
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]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/hwmon/hwmon-vid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c
index 89cfd64..ef91b8a 100644
--- a/drivers/hwmon/hwmon-vid.c
+++ b/drivers/hwmon/hwmon-vid.c
@@ -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"
};
--
1.7.9.7
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [lm-sensors] [PATCH] hwmon: (hwmon-vid) Add __maybe_unused attribute to dummy variable
2013-09-09 10:53 [lm-sensors] [PATCH] hwmon: (hwmon-vid) Add __maybe_unused attribute to dummy variable Guenter Roeck
@ 2013-09-10 7:37 ` Jean Delvare
2013-09-10 13:27 ` Guenter Roeck
1 sibling, 0 replies; 3+ messages in thread
From: Jean Delvare @ 2013-09-10 7:37 UTC (permalink / raw)
To: lm-sensors
Hi Guenter,
On Mon, 9 Sep 2013 03:53:21 -0700, Guenter Roeck wrote:
> 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.
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/hwmon/hwmon-vid.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c
> index 89cfd64..ef91b8a 100644
> --- a/drivers/hwmon/hwmon-vid.c
> +++ b/drivers/hwmon/hwmon-vid.c
> @@ -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.
Reviewed-by: Jean Delvare <khali@linux-fr.org>
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [lm-sensors] [PATCH] hwmon: (hwmon-vid) Add __maybe_unused attribute to dummy variable
2013-09-09 10:53 [lm-sensors] [PATCH] hwmon: (hwmon-vid) Add __maybe_unused attribute to dummy variable Guenter Roeck
2013-09-10 7:37 ` Jean Delvare
@ 2013-09-10 13:27 ` Guenter Roeck
1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2013-09-10 13:27 UTC (permalink / raw)
To: lm-sensors
On 09/10/2013 12:37 AM, Jean Delvare wrote:
> Hi Guenter,
>
> On Mon, 9 Sep 2013 03:53:21 -0700, Guenter Roeck wrote:
>> 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).
>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
>> ---
>> drivers/hwmon/hwmon-vid.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c
>> index 89cfd64..ef91b8a 100644
>> --- a/drivers/hwmon/hwmon-vid.c
>> +++ b/drivers/hwmon/hwmon-vid.c
>> @@ -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.
>
> Reviewed-by: Jean Delvare <khali@linux-fr.org>
>
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-09-10 13:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-09 10:53 [lm-sensors] [PATCH] hwmon: (hwmon-vid) Add __maybe_unused attribute to dummy variable Guenter Roeck
2013-09-10 7:37 ` Jean Delvare
2013-09-10 13:27 ` Guenter Roeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.