Re: [PATCH] hwmon: (hwmon-vid) Add __maybe_unused attribute to dummy variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx>
> ---
>  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@xxxxxxxxxxxx>

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux