Skip to contentSkip to conversation

iio: imu: inv_mpu6050: Remove casting the return value which is a void pointer

PATCH Applied Jingoo Han 2 participants 2 messages Aug 29, 2014 – Aug 30, 2014

Subsystems (2)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 iio: imu: inv_mpu6050: 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/iio/imu/inv_mpu6050/inv_mpu_core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +1 -2
index 0c6517c94a9d..b75519deac1a 100644
@@ -673,8 +673,7 @@ static int inv_mpu_probe(struct i2c_client *client,
 
 	st = iio_priv(indio_dev);
 	st->client = client;
-	pdata = (struct inv_mpu6050_platform_data
-			*)dev_get_platdata(&client->dev);
+	pdata = dev_get_platdata(&client->dev);
 	if (pdata)
 		st->plat_data = *pdata;
 	/* power is turned on inside check chip type*/
Signature · 1 line
2.0.0
maintainer Applied
#1 lore raw
Quoted 5 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.

Applied to the togreg branch of iio.git - initially pushed out as testing for the autobuilders to play.

Thanks,

Jonathan

Quoted 19 lines
---
 drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +1 -2
index 0c6517c94a9d..b75519deac1a 100644
@@ -673,8 +673,7 @@ static int inv_mpu_probe(struct i2c_client *client,
 
 	st = iio_priv(indio_dev);
 	st->client = client;
-	pdata = (struct inv_mpu6050_platform_data
-			*)dev_get_platdata(&client->dev);
+	pdata = dev_get_platdata(&client->dev);
 	if (pdata)
 		st->plat_data = *pdata;
 	/* power is turned on inside check chip type*/