Skip to contentSkip to conversation

hwmon: (ina2xx) Remove casting the return value which is a void pointer

PATCH Applied Jingoo Han 3 participants 3 messages Sep 9, 2013 Hardware monitoring

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/hwmon/ina2xx.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/hwmon/ina2xx.c +1 -1
index 18c0623..70a39a8 100644
@@ -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)) {
Signature · 8 lines
1.7.10.4



_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · Jingoo Han

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.

---
 drivers/hwmon/ina2xx.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/hwmon/ina2xx.c +0 -0
index 18c0623..70a39a8 100644

drivers/hwmon/ina2xx.c static int ina2xx_probe(struct i2c_client *client, · line 239

Quoted 8 lines
drivers/hwmon/ina2xx.c +1 -1
@@ -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)) {

Guenter, I'll let you pick it.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
maintainer Applied
#2 lore raw
In reply to Jingoo Han
Quoted 26 lines · Jean Delvare
Quoted 14 lines · Jingoo Han

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.

---
  drivers/hwmon/ina2xx.c |    3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/hwmon/ina2xx.c +0 -0
index 18c0623..70a39a8 100644

drivers/hwmon/ina2xx.c static int ina2xx_probe(struct i2c_client *client, · line 239

Quoted 8 lines
drivers/hwmon/ina2xx.c +1 -1
@@ -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)) {
Quoted 2 lines

Guenter, I'll let you pick it.

Applied, thanks

Guenter

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