From 98128de30f4bb2adc29028fdd5839de83bc4bcff Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Sun, 8 Sep 2013 19:31:59 -0700 Subject: [PATCH 1/2] 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] Signed-off-by: Guenter Roeck Reviewed-by: Jean Delvare --- 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 89cfd64b3373..ef91b8a67549 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" }; From 8876dd78d9f0cd317d55dc19e5cd17194af15b52 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Mon, 9 Sep 2013 14:29:32 +0900 Subject: [PATCH 2/2] hwmon: (ina2xx) Remove casting the return value which is a void pointer Casting the return value which is a void pointer is redundant. The conversion from void pointer to any other pointer type is guaranteed by the C programming language. Signed-off-by: Jingoo Han Acked-by: Jean Delvare Signed-off-by: Guenter Roeck --- drivers/hwmon/ina2xx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c index 18c062360ca7..70a39a8ac016 100644 --- a/drivers/hwmon/ina2xx.c +++ b/drivers/hwmon/ina2xx.c @@ -233,8 +233,7 @@ static int ina2xx_probe(struct i2c_client *client, return -ENOMEM; if (dev_get_platdata(&client->dev)) { - pdata = - (struct ina2xx_platform_data *)dev_get_platdata(&client->dev); + pdata = dev_get_platdata(&client->dev); shunt = pdata->shunt_uohms; } else if (!of_property_read_u32(client->dev.of_node, "shunt-resistor", &val)) {