All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	linux-iio@vger.kernel.org, Denis Ciocca <denis.ciocca@st.com>
Subject: Re: [PATCH v2 3/8] iio: st_sensors: Drop unneeded explicit castings
Date: Sun, 15 Mar 2020 12:38:47 +0000	[thread overview]
Message-ID: <20200315123847.177c7a2e@archlinux> (raw)
In-Reply-To: <20200313104955.30423-3-andriy.shevchenko@linux.intel.com>

On Fri, 13 Mar 2020 12:49:50 +0200
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> In few places the unnecessary explicit castings are being used.
> Drop them for good.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Applied.  Thanks,

Jonathan

> ---
> v2: more conversions to cast-less approach
>  drivers/iio/accel/st_accel_buffer.c             | 3 +--
>  drivers/iio/accel/st_accel_core.c               | 3 +--
>  drivers/iio/common/st_sensors/st_sensors_core.c | 3 +--
>  drivers/iio/gyro/st_gyro_buffer.c               | 3 +--
>  drivers/iio/gyro/st_gyro_core.c                 | 9 +++++----
>  drivers/iio/magnetometer/st_magn_core.c         | 3 +--
>  drivers/iio/pressure/st_pressure_core.c         | 4 +---
>  7 files changed, 11 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/iio/accel/st_accel_buffer.c b/drivers/iio/accel/st_accel_buffer.c
> index 9f2b40474b8e..b5c814ef1637 100644
> --- a/drivers/iio/accel/st_accel_buffer.c
> +++ b/drivers/iio/accel/st_accel_buffer.c
> @@ -37,8 +37,7 @@ static int st_accel_buffer_postenable(struct iio_dev *indio_dev)
>  	if (err < 0)
>  		return err;
>  
> -	err = st_sensors_set_axis_enable(indio_dev,
> -					 (u8)indio_dev->active_scan_mask[0]);
> +	err = st_sensors_set_axis_enable(indio_dev, indio_dev->active_scan_mask[0]);
>  	if (err < 0)
>  		goto st_accel_buffer_predisable;
>  
> diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c
> index 5f7bdb1f55d1..e2ec5d127495 100644
> --- a/drivers/iio/accel/st_accel_core.c
> +++ b/drivers/iio/accel/st_accel_core.c
> @@ -1203,8 +1203,7 @@ int st_accel_common_probe(struct iio_dev *indio_dev)
>  			 "failed to apply ACPI orientation data: %d\n", err);
>  
>  	indio_dev->channels = channels;
> -	adata->current_fullscale = (struct st_sensor_fullscale_avl *)
> -					&adata->sensor_settings->fs.fs_avl[0];
> +	adata->current_fullscale = &adata->sensor_settings->fs.fs_avl[0];
>  	adata->odr = adata->sensor_settings->odr.odr_avl[0].hz;
>  
>  	if (!pdata)
> diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c
> index e051edbc43c1..804a9068e687 100644
> --- a/drivers/iio/common/st_sensors/st_sensors_core.c
> +++ b/drivers/iio/common/st_sensors/st_sensors_core.c
> @@ -150,8 +150,7 @@ static int st_sensors_set_fullscale(struct iio_dev *indio_dev, unsigned int fs)
>  	if (err < 0)
>  		goto st_accel_set_fullscale_error;
>  
> -	sdata->current_fullscale = (struct st_sensor_fullscale_avl *)
> -					&sdata->sensor_settings->fs.fs_avl[i];
> +	sdata->current_fullscale = &sdata->sensor_settings->fs.fs_avl[i];
>  	return err;
>  
>  st_accel_set_fullscale_error:
> diff --git a/drivers/iio/gyro/st_gyro_buffer.c b/drivers/iio/gyro/st_gyro_buffer.c
> index 7465ad62391c..9c92ff7a82be 100644
> --- a/drivers/iio/gyro/st_gyro_buffer.c
> +++ b/drivers/iio/gyro/st_gyro_buffer.c
> @@ -37,8 +37,7 @@ static int st_gyro_buffer_postenable(struct iio_dev *indio_dev)
>  	if (err < 0)
>  		return err;
>  
> -	err = st_sensors_set_axis_enable(indio_dev,
> -					 (u8)indio_dev->active_scan_mask[0]);
> +	err = st_sensors_set_axis_enable(indio_dev, indio_dev->active_scan_mask[0]);
>  	if (err < 0)
>  		goto st_gyro_buffer_predisable;
>  
> diff --git a/drivers/iio/gyro/st_gyro_core.c b/drivers/iio/gyro/st_gyro_core.c
> index 26c50b24bc08..c8aa051995d3 100644
> --- a/drivers/iio/gyro/st_gyro_core.c
> +++ b/drivers/iio/gyro/st_gyro_core.c
> @@ -460,6 +460,7 @@ EXPORT_SYMBOL(st_gyro_get_settings);
>  int st_gyro_common_probe(struct iio_dev *indio_dev)
>  {
>  	struct st_sensor_data *gdata = iio_priv(indio_dev);
> +	struct st_sensors_platform_data *pdata;
>  	int err;
>  
>  	indio_dev->modes = INDIO_DIRECT_MODE;
> @@ -477,12 +478,12 @@ int st_gyro_common_probe(struct iio_dev *indio_dev)
>  	indio_dev->channels = gdata->sensor_settings->ch;
>  	indio_dev->num_channels = ST_SENSORS_NUMBER_ALL_CHANNELS;
>  
> -	gdata->current_fullscale = (struct st_sensor_fullscale_avl *)
> -					&gdata->sensor_settings->fs.fs_avl[0];
> +	gdata->current_fullscale = &gdata->sensor_settings->fs.fs_avl[0];
>  	gdata->odr = gdata->sensor_settings->odr.odr_avl[0].hz;
>  
> -	err = st_sensors_init_sensor(indio_dev,
> -				(struct st_sensors_platform_data *)&gyro_pdata);
> +	pdata = (struct st_sensors_platform_data *)&gyro_pdata;
> +
> +	err = st_sensors_init_sensor(indio_dev, pdata);
>  	if (err < 0)
>  		goto st_gyro_power_off;
>  
> diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c
> index e68184a93a6d..79de721e6015 100644
> --- a/drivers/iio/magnetometer/st_magn_core.c
> +++ b/drivers/iio/magnetometer/st_magn_core.c
> @@ -506,8 +506,7 @@ int st_magn_common_probe(struct iio_dev *indio_dev)
>  	indio_dev->channels = mdata->sensor_settings->ch;
>  	indio_dev->num_channels = ST_SENSORS_NUMBER_ALL_CHANNELS;
>  
> -	mdata->current_fullscale = (struct st_sensor_fullscale_avl *)
> -					&mdata->sensor_settings->fs.fs_avl[0];
> +	mdata->current_fullscale = &mdata->sensor_settings->fs.fs_avl[0];
>  	mdata->odr = mdata->sensor_settings->odr.odr_avl[0].hz;
>  
>  	err = st_sensors_init_sensor(indio_dev, NULL);
> diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
> index 8bb47c3b4d6b..789a2928504a 100644
> --- a/drivers/iio/pressure/st_pressure_core.c
> +++ b/drivers/iio/pressure/st_pressure_core.c
> @@ -707,9 +707,7 @@ int st_press_common_probe(struct iio_dev *indio_dev)
>  	indio_dev->channels = press_data->sensor_settings->ch;
>  	indio_dev->num_channels = press_data->sensor_settings->num_ch;
>  
> -	press_data->current_fullscale =
> -		(struct st_sensor_fullscale_avl *)
> -			&press_data->sensor_settings->fs.fs_avl[0];
> +	press_data->current_fullscale = &press_data->sensor_settings->fs.fs_avl[0];
>  
>  	press_data->odr = press_data->sensor_settings->odr.odr_avl[0].hz;
>  


  reply	other threads:[~2020-03-15 12:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-13 10:49 [PATCH v2 1/8] iio: light: st_uvis25: Drop unneeded casting when print error code Andy Shevchenko
2020-03-13 10:49 ` [PATCH v2 2/8] iio: st_sensors: Use dev_get_platdata() to get platform_data Andy Shevchenko
2020-03-15 12:34   ` Jonathan Cameron
2020-03-13 10:49 ` [PATCH v2 3/8] iio: st_sensors: Drop unneeded explicit castings Andy Shevchenko
2020-03-15 12:38   ` Jonathan Cameron [this message]
2020-03-13 10:49 ` [PATCH v2 4/8] iio: st_sensors: Drop unneeded casting when print error code Andy Shevchenko
2020-03-15 12:40   ` Jonathan Cameron
2020-03-13 10:49 ` [PATCH v2 5/8] iio: st_sensors: Join string literals back Andy Shevchenko
2020-03-15 12:40   ` Jonathan Cameron
2020-03-13 10:49 ` [PATCH v2 6/8] iio: humidity: hts221: Use dev_get_platdata() to get platform_data Andy Shevchenko
2020-03-15 12:42   ` Jonathan Cameron
2020-03-13 10:49 ` [PATCH v2 7/8] iio: humidity: hts221: Make use of device properties Andy Shevchenko
2020-03-15 12:43   ` Jonathan Cameron
2020-03-13 10:49 ` [PATCH v2 8/8] iio: humidity: hts221: Drop unneeded casting when print error code Andy Shevchenko
2020-03-15 12:44   ` Jonathan Cameron
2020-03-16  8:27     ` Andy Shevchenko
2020-03-15 12:26 ` [PATCH v2 1/8] iio: light: st_uvis25: " Jonathan Cameron
2020-03-15 12:31   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200315123847.177c7a2e@archlinux \
    --to=jic23@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=denis.ciocca@st.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.