diff mbox series

[2/6] iio:chemical:atlas-sensor: Drop unnecessary explicit casts in regmap_bulk_read calls

Message ID 20200405180321.1737310-3-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>
Cc: Matt Ranostay <matt.ranostay@konsulko.com>
---
 drivers/iio/chemical/atlas-sensor.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Matt Ranostay April 6, 2020, 12:54 a.m. UTC | #1
On Sun, Apr 5, 2020 at 11:05 AM <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 *.
>

Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>

> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Matt Ranostay <matt.ranostay@konsulko.com>
> ---
>  drivers/iio/chemical/atlas-sensor.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iio/chemical/atlas-sensor.c b/drivers/iio/chemical/atlas-sensor.c
> index 82d470561ad3..973cdb4f1e83 100644
> --- a/drivers/iio/chemical/atlas-sensor.c
> +++ b/drivers/iio/chemical/atlas-sensor.c
> @@ -426,8 +426,7 @@ static irqreturn_t atlas_trigger_handler(int irq, void *private)
>         int ret;
>
>         ret = regmap_bulk_read(data->regmap, data->chip->data_reg,
> -                             (u8 *) &data->buffer,
> -                             sizeof(__be32) * channels);
> +                             &data->buffer, sizeof(__be32) * channels);
>
>         if (!ret)
>                 iio_push_to_buffers_with_timestamp(indio_dev, data->buffer,
> @@ -463,7 +462,7 @@ static int atlas_read_measurement(struct atlas_data *data, int reg, __be32 *val)
>         if (suspended)
>                 msleep(data->chip->delay);
>
> -       ret = regmap_bulk_read(data->regmap, reg, (u8 *) val, sizeof(*val));
> +       ret = regmap_bulk_read(data->regmap, reg, val, sizeof(*val));
>
>         pm_runtime_mark_last_busy(dev);
>         pm_runtime_put_autosuspend(dev);
> @@ -485,7 +484,7 @@ static int atlas_read_raw(struct iio_dev *indio_dev,
>                 switch (chan->type) {
>                 case IIO_TEMP:
>                         ret = regmap_bulk_read(data->regmap, chan->address,
> -                                             (u8 *) &reg, sizeof(reg));
> +                                              &reg, sizeof(reg));
>                         break;
>                 case IIO_PH:
>                 case IIO_CONCENTRATION:
> --
> 2.26.0
>
diff mbox series

Patch

diff --git a/drivers/iio/chemical/atlas-sensor.c b/drivers/iio/chemical/atlas-sensor.c
index 82d470561ad3..973cdb4f1e83 100644
--- a/drivers/iio/chemical/atlas-sensor.c
+++ b/drivers/iio/chemical/atlas-sensor.c
@@ -426,8 +426,7 @@  static irqreturn_t atlas_trigger_handler(int irq, void *private)
 	int ret;
 
 	ret = regmap_bulk_read(data->regmap, data->chip->data_reg,
-			      (u8 *) &data->buffer,
-			      sizeof(__be32) * channels);
+			      &data->buffer, sizeof(__be32) * channels);
 
 	if (!ret)
 		iio_push_to_buffers_with_timestamp(indio_dev, data->buffer,
@@ -463,7 +462,7 @@  static int atlas_read_measurement(struct atlas_data *data, int reg, __be32 *val)
 	if (suspended)
 		msleep(data->chip->delay);
 
-	ret = regmap_bulk_read(data->regmap, reg, (u8 *) val, sizeof(*val));
+	ret = regmap_bulk_read(data->regmap, reg, val, sizeof(*val));
 
 	pm_runtime_mark_last_busy(dev);
 	pm_runtime_put_autosuspend(dev);
@@ -485,7 +484,7 @@  static int atlas_read_raw(struct iio_dev *indio_dev,
 		switch (chan->type) {
 		case IIO_TEMP:
 			ret = regmap_bulk_read(data->regmap, chan->address,
-					      (u8 *) &reg, sizeof(reg));
+					       &reg, sizeof(reg));
 			break;
 		case IIO_PH:
 		case IIO_CONCENTRATION: