diff mbox series

[1/6] iio:accel:mxc4005: Drop unnecessary explicit casts in regmap_bulk_read calls

Message ID 20200405180321.1737310-2-jic23@kernel.org (mailing list archive)
State New, archived
Headers show
Series IIO: Tidy up parameters to regmap_bulk_* calls | expand

Commit Message

Jonathan Cameron April 5, 2020, 6:03 p.m. UTC
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

regmap_bulk_read takes a void * for its val parameter. It certainly
makes no sense to cast to a (u8 *) + no need to explicitly cast
at all when converting another pointer type to void *.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/iio/accel/mxc4005.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Alexandru Ardelean April 13, 2020, 4:31 a.m. UTC | #1
On Sun, 2020-04-05 at 19:03 +0100, jic23@kernel.org wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> regmap_bulk_read takes a void * for its val parameter. It certainly
> makes no sense to cast to a (u8 *) + no need to explicitly cast
> at all when converting another pointer type to void *.
> 

Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>

> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
>  drivers/iio/accel/mxc4005.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/accel/mxc4005.c b/drivers/iio/accel/mxc4005.c
> index 3d5bea651923..9d07642c0de1 100644
> --- a/drivers/iio/accel/mxc4005.c
> +++ b/drivers/iio/accel/mxc4005.c
> @@ -135,7 +135,7 @@ static int mxc4005_read_xyz(struct mxc4005_data *data)
>  	int ret;
>  
>  	ret = regmap_bulk_read(data->regmap, MXC4005_REG_XOUT_UPPER,
> -			       (u8 *) data->buffer, sizeof(data->buffer));
> +			       data->buffer, sizeof(data->buffer));
>  	if (ret < 0) {
>  		dev_err(data->dev, "failed to read axes\n");
>  		return ret;
> @@ -150,7 +150,7 @@ static int mxc4005_read_axis(struct mxc4005_data *data,
>  	__be16 reg;
>  	int ret;
>  
> -	ret = regmap_bulk_read(data->regmap, addr, (u8 *) &reg, sizeof(reg));
> +	ret = regmap_bulk_read(data->regmap, addr, &reg, sizeof(reg));
>  	if (ret < 0) {
>  		dev_err(data->dev, "failed to read reg %02x\n", addr);
>  		return ret;
diff mbox series

Patch

diff --git a/drivers/iio/accel/mxc4005.c b/drivers/iio/accel/mxc4005.c
index 3d5bea651923..9d07642c0de1 100644
--- a/drivers/iio/accel/mxc4005.c
+++ b/drivers/iio/accel/mxc4005.c
@@ -135,7 +135,7 @@  static int mxc4005_read_xyz(struct mxc4005_data *data)
 	int ret;
 
 	ret = regmap_bulk_read(data->regmap, MXC4005_REG_XOUT_UPPER,
-			       (u8 *) data->buffer, sizeof(data->buffer));
+			       data->buffer, sizeof(data->buffer));
 	if (ret < 0) {
 		dev_err(data->dev, "failed to read axes\n");
 		return ret;
@@ -150,7 +150,7 @@  static int mxc4005_read_axis(struct mxc4005_data *data,
 	__be16 reg;
 	int ret;
 
-	ret = regmap_bulk_read(data->regmap, addr, (u8 *) &reg, sizeof(reg));
+	ret = regmap_bulk_read(data->regmap, addr, &reg, sizeof(reg));
 	if (ret < 0) {
 		dev_err(data->dev, "failed to read reg %02x\n", addr);
 		return ret;