All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH 02/27] iio: Remove unnecessary casts for iio_push_to_buffers()
Date: Sun, 15 Sep 2013 19:05:30 +0100	[thread overview]
Message-ID: <5235F6EA.8080004@kernel.org> (raw)
In-Reply-To: <1379263880-18405-2-git-send-email-lars@metafoo.de>

On 09/15/13 17:50, Lars-Peter Clausen wrote:
> Now that iio_push_to_buffers() takes a void pointer for the data parameter we
> can remove those casts to u8*.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
applied.
> ---
>  drivers/iio/accel/bma180.c                    | 2 +-
>  drivers/iio/accel/hid-sensor-accel-3d.c       | 7 ++++---
>  drivers/iio/adc/ad7266.c                      | 2 +-
>  drivers/iio/adc/ad7298.c                      | 2 +-
>  drivers/iio/adc/ad7923.c                      | 2 +-
>  drivers/iio/adc/ad_sigma_delta.c              | 2 +-
>  drivers/iio/adc/at91_adc.c                    | 2 +-
>  drivers/iio/gyro/hid-sensor-gyro-3d.c         | 7 ++++---
>  drivers/iio/gyro/itg3200_buffer.c             | 2 +-
>  drivers/iio/light/adjd_s311.c                 | 2 +-
>  drivers/iio/light/hid-sensor-als.c            | 7 ++++---
>  drivers/iio/light/tcs3472.c                   | 2 +-
>  drivers/iio/magnetometer/hid-sensor-magn-3d.c | 7 ++++---
>  13 files changed, 25 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c
> index 12e32e6..3eff246 100644
> --- a/drivers/iio/accel/bma180.c
> +++ b/drivers/iio/accel/bma180.c
> @@ -490,7 +490,7 @@ static irqreturn_t bma180_trigger_handler(int irq, void *p)
>  	}
>  	mutex_unlock(&data->mutex);
>  
> -	iio_push_to_buffers(indio_dev, (u8 *)data->buff);
> +	iio_push_to_buffers(indio_dev, data->buff);
>  err:
>  	iio_trigger_notify_done(indio_dev->trig);
>  
> diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b/drivers/iio/accel/hid-sensor-accel-3d.c
> index 46d22f3..dcda173 100644
> --- a/drivers/iio/accel/hid-sensor-accel-3d.c
> +++ b/drivers/iio/accel/hid-sensor-accel-3d.c
> @@ -182,10 +182,11 @@ static const struct iio_info accel_3d_info = {
>  };
>  
>  /* Function to push data to buffer */
> -static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len)
> +static void hid_sensor_push_data(struct iio_dev *indio_dev, const void *data,
> +	int len)
>  {
>  	dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n");
> -	iio_push_to_buffers(indio_dev, (u8 *)data);
> +	iio_push_to_buffers(indio_dev, data);
>  }
>  
>  /* Callback handler to send event after all samples are received and captured */
> @@ -200,7 +201,7 @@ static int accel_3d_proc_event(struct hid_sensor_hub_device *hsdev,
>  				accel_state->common_attributes.data_ready);
>  	if (accel_state->common_attributes.data_ready)
>  		hid_sensor_push_data(indio_dev,
> -				(u8 *)accel_state->accel_val,
> +				accel_state->accel_val,
>  				sizeof(accel_state->accel_val));
>  
>  	return 0;
> diff --git a/drivers/iio/adc/ad7266.c b/drivers/iio/adc/ad7266.c
> index 371731d..5bfed23 100644
> --- a/drivers/iio/adc/ad7266.c
> +++ b/drivers/iio/adc/ad7266.c
> @@ -98,7 +98,7 @@ static irqreturn_t ad7266_trigger_handler(int irq, void *p)
>  	if (ret == 0) {
>  		if (indio_dev->scan_timestamp)
>  			((s64 *)st->data)[1] = pf->timestamp;
> -		iio_push_to_buffers(indio_dev, (u8 *)st->data);
> +		iio_push_to_buffers(indio_dev, st->data);
>  	}
>  
>  	iio_trigger_notify_done(indio_dev->trig);
> diff --git a/drivers/iio/adc/ad7298.c b/drivers/iio/adc/ad7298.c
> index 85d1481..0812556 100644
> --- a/drivers/iio/adc/ad7298.c
> +++ b/drivers/iio/adc/ad7298.c
> @@ -172,7 +172,7 @@ static irqreturn_t ad7298_trigger_handler(int irq, void *p)
>  			&time_ns, sizeof(time_ns));
>  	}
>  
> -	iio_push_to_buffers(indio_dev, (u8 *)st->rx_buf);
> +	iio_push_to_buffers(indio_dev, st->rx_buf);
>  
>  done:
>  	iio_trigger_notify_done(indio_dev->trig);
> diff --git a/drivers/iio/adc/ad7923.c b/drivers/iio/adc/ad7923.c
> index 4108dbb..7eb4cb5 100644
> --- a/drivers/iio/adc/ad7923.c
> +++ b/drivers/iio/adc/ad7923.c
> @@ -187,7 +187,7 @@ static irqreturn_t ad7923_trigger_handler(int irq, void *p)
>  			&time_ns, sizeof(time_ns));
>  	}
>  
> -	iio_push_to_buffers(indio_dev, (u8 *)st->rx_buf);
> +	iio_push_to_buffers(indio_dev, st->rx_buf);
>  
>  done:
>  	iio_trigger_notify_done(indio_dev->trig);
> diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c
> index f0d6335..78d276f 100644
> --- a/drivers/iio/adc/ad_sigma_delta.c
> +++ b/drivers/iio/adc/ad_sigma_delta.c
> @@ -391,7 +391,7 @@ static irqreturn_t ad_sd_trigger_handler(int irq, void *p)
>  		break;
>  	}
>  
> -	iio_push_to_buffers(indio_dev, (uint8_t *)data);
> +	iio_push_to_buffers(indio_dev, data);
>  
>  	iio_trigger_notify_done(indio_dev->trig);
>  	sigma_delta->irq_dis = false;
> diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
> index 84be63b..6da5ebb 100644
> --- a/drivers/iio/adc/at91_adc.c
> +++ b/drivers/iio/adc/at91_adc.c
> @@ -89,7 +89,7 @@ static irqreturn_t at91_adc_trigger_handler(int irq, void *p)
>  		*timestamp = pf->timestamp;
>  	}
>  
> -	iio_push_to_buffers(idev, (u8 *)st->buffer);
> +	iio_push_to_buffers(idev, st->buffer);
>  
>  	iio_trigger_notify_done(idev->trig);
>  
> diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c
> index c688d97..ea01c6bc 100644
> --- a/drivers/iio/gyro/hid-sensor-gyro-3d.c
> +++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c
> @@ -182,10 +182,11 @@ static const struct iio_info gyro_3d_info = {
>  };
>  
>  /* Function to push data to buffer */
> -static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len)
> +static void hid_sensor_push_data(struct iio_dev *indio_dev, const void *data,
> +	int len)
>  {
>  	dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n");
> -	iio_push_to_buffers(indio_dev, (u8 *)data);
> +	iio_push_to_buffers(indio_dev, data);
>  }
>  
>  /* Callback handler to send event after all samples are received and captured */
> @@ -200,7 +201,7 @@ static int gyro_3d_proc_event(struct hid_sensor_hub_device *hsdev,
>  				gyro_state->common_attributes.data_ready);
>  	if (gyro_state->common_attributes.data_ready)
>  		hid_sensor_push_data(indio_dev,
> -				(u8 *)gyro_state->gyro_val,
> +				gyro_state->gyro_val,
>  				sizeof(gyro_state->gyro_val));
>  
>  	return 0;
> diff --git a/drivers/iio/gyro/itg3200_buffer.c b/drivers/iio/gyro/itg3200_buffer.c
> index 6c43af9..6b3c301 100644
> --- a/drivers/iio/gyro/itg3200_buffer.c
> +++ b/drivers/iio/gyro/itg3200_buffer.c
> @@ -59,7 +59,7 @@ static irqreturn_t itg3200_trigger_handler(int irq, void *p)
>  		memcpy(buf + indio_dev->scan_bytes - sizeof(s64),
>  				&pf->timestamp, sizeof(pf->timestamp));
>  
> -	iio_push_to_buffers(indio_dev, (u8 *)buf);
> +	iio_push_to_buffers(indio_dev, buf);
>  	iio_trigger_notify_done(indio_dev->trig);
>  
>  error_ret:
> diff --git a/drivers/iio/light/adjd_s311.c b/drivers/iio/light/adjd_s311.c
> index c0da351..c9c8b00 100644
> --- a/drivers/iio/light/adjd_s311.c
> +++ b/drivers/iio/light/adjd_s311.c
> @@ -141,7 +141,7 @@ static irqreturn_t adjd_s311_trigger_handler(int irq, void *p)
>  	if (indio_dev->scan_timestamp)
>  		*(s64 *)((u8 *)data->buffer + ALIGN(len, sizeof(s64)))
>  			= time_ns;
> -	iio_push_to_buffers(indio_dev, (u8 *)data->buffer);
> +	iio_push_to_buffers(indio_dev, data->buffer);
>  
>  done:
>  	iio_trigger_notify_done(indio_dev->trig);
> diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c
> index e59d00c..fa6ae8c 100644
> --- a/drivers/iio/light/hid-sensor-als.c
> +++ b/drivers/iio/light/hid-sensor-als.c
> @@ -161,10 +161,11 @@ static const struct iio_info als_info = {
>  };
>  
>  /* Function to push data to buffer */
> -static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len)
> +static void hid_sensor_push_data(struct iio_dev *indio_dev, const void *data,
> +					int len)
>  {
>  	dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n");
> -	iio_push_to_buffers(indio_dev, (u8 *)data);
> +	iio_push_to_buffers(indio_dev, data);
>  }
>  
>  /* Callback handler to send event after all samples are received and captured */
> @@ -179,7 +180,7 @@ static int als_proc_event(struct hid_sensor_hub_device *hsdev,
>  				als_state->common_attributes.data_ready);
>  	if (als_state->common_attributes.data_ready)
>  		hid_sensor_push_data(indio_dev,
> -				(u8 *)&als_state->illum,
> +				&als_state->illum,
>  				sizeof(als_state->illum));
>  
>  	return 0;
> diff --git a/drivers/iio/light/tcs3472.c b/drivers/iio/light/tcs3472.c
> index dc7d823..7bf2969 100644
> --- a/drivers/iio/light/tcs3472.c
> +++ b/drivers/iio/light/tcs3472.c
> @@ -195,7 +195,7 @@ static irqreturn_t tcs3472_trigger_handler(int irq, void *p)
>  	if (indio_dev->scan_timestamp)
>  		*(s64 *)((u8 *)data->buffer + ALIGN(len, sizeof(s64)))
>  			= iio_get_time_ns();
> -	iio_push_to_buffers(indio_dev, (u8 *)data->buffer);
> +	iio_push_to_buffers(indio_dev, data->buffer);
>  
>  done:
>  	iio_trigger_notify_done(indio_dev->trig);
> diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
> index a98460b..2634920 100644
> --- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c
> +++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
> @@ -183,10 +183,11 @@ static const struct iio_info magn_3d_info = {
>  };
>  
>  /* Function to push data to buffer */
> -static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len)
> +static void hid_sensor_push_data(struct iio_dev *indio_dev, const void *data,
> +	int len)
>  {
>  	dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n");
> -	iio_push_to_buffers(indio_dev, (u8 *)data);
> +	iio_push_to_buffers(indio_dev, data);
>  }
>  
>  /* Callback handler to send event after all samples are received and captured */
> @@ -201,7 +202,7 @@ static int magn_3d_proc_event(struct hid_sensor_hub_device *hsdev,
>  				magn_state->common_attributes.data_ready);
>  	if (magn_state->common_attributes.data_ready)
>  		hid_sensor_push_data(indio_dev,
> -				(u8 *)magn_state->magn_val,
> +				magn_state->magn_val,
>  				sizeof(magn_state->magn_val));
>  
>  	return 0;
> 

  reply	other threads:[~2013-09-15 17:05 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-15 16:50 [PATCH 01/27] iio: iio_push_to_buffers(): Change type of 'data' to const void * Lars-Peter Clausen
2013-09-15 16:50 ` [PATCH 02/27] iio: Remove unnecessary casts for iio_push_to_buffers() Lars-Peter Clausen
2013-09-15 18:05   ` Jonathan Cameron [this message]
2013-09-15 16:50 ` [PATCH 03/27] staging:iio: " Lars-Peter Clausen
2013-09-15 18:06   ` Jonathan Cameron
2013-09-15 16:50 ` [PATCH 04/27] iio: Add iio_push_buffers_with_timestamp() helper Lars-Peter Clausen
2013-09-15 17:44   ` Peter Meerwald
2013-09-16  7:52   ` Jonathan Cameron
2013-09-16  7:58     ` Peter Meerwald
2013-09-16  8:19       ` Lars-Peter Clausen
2013-09-16 18:35         ` Jonathan Cameron
2013-09-16  8:19     ` Lars-Peter Clausen
2013-09-16 18:37       ` Jonathan Cameron
2013-09-16 20:42         ` Lars-Peter Clausen
2013-09-15 16:50 ` [PATCH 05/27] iio:bma180: Use iio_push_buffers_with_timestamp() Lars-Peter Clausen
2013-09-15 16:50 ` [PATCH 06/27] iio:ad7266: Use iio_push_to_buffers_with_timestamp() Lars-Peter Clausen
2013-09-15 16:51 ` [PATCH 07/27] iio:ad7298: " Lars-Peter Clausen
2013-09-15 16:51 ` [PATCH 08/27] iio:ad7476: " Lars-Peter Clausen
2013-09-15 16:51 ` [PATCH 09/27] iio:ad7887: " Lars-Peter Clausen
2013-09-15 16:51 ` [PATCH 10/27] iio:ad7923: " Lars-Peter Clausen
2013-09-15 16:51 ` [PATCH 11/27] iio:ad_sigma_delta: " Lars-Peter Clausen
2013-09-15 16:51 ` [PATCH 12/27] iio:at91_adc: " Lars-Peter Clausen
2013-09-15 16:51 ` [PATCH 13/27] iio:max1363: " Lars-Peter Clausen
2013-09-15 16:51 ` [PATCH 14/27] iio:st_sensors: " Lars-Peter Clausen
2013-09-15 16:51 ` [PATCH 15/27] iio:itg3200: " Lars-Peter Clausen
2013-09-15 16:51 ` [PATCH 16/27] iio:adis16400: " Lars-Peter Clausen
2013-09-15 16:51 ` [PATCH 17/27] iio:adis_lib: " Lars-Peter Clausen
2013-09-15 16:51 ` [PATCH 18/27] iio:mpu6050: " Lars-Peter Clausen
2013-09-15 16:51 ` [PATCH 19/27] iio:adjd_s311: " Lars-Peter Clausen
2013-09-15 16:51 ` [PATCH 20/27] iio:tcs3472: " Lars-Peter Clausen
2013-09-15 16:51 ` [PATCH 21/27] iio:gp2ap020a00f: " Lars-Peter Clausen
2013-09-15 16:51 ` [PATCH 22/27] staging:iio:lis3l02dq: " Lars-Peter Clausen
2013-09-15 16:51 ` [PATCH 23/27] staging:iio:ad7606: " Lars-Peter Clausen
2013-09-15 16:51 ` [PATCH 24/27] staging:iio:ad799x: " Lars-Peter Clausen
2013-09-15 16:51 ` [PATCH 25/27] staging:iio:mxs-lradc: " Lars-Peter Clausen
2013-09-16 13:53   ` Marek Vasut
2013-09-16 16:54     ` Lars-Peter Clausen
2013-09-16 17:08       ` Marek Vasut
2013-09-15 16:51 ` [PATCH 26/27] staging:iio:dummy: " Lars-Peter Clausen
2013-09-15 16:51 ` [PATCH 27/27] staging:iio:ade7758: " Lars-Peter Clausen
2013-09-15 18:04 ` [PATCH 01/27] iio: iio_push_to_buffers(): Change type of 'data' to const void * 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=5235F6EA.8080004@kernel.org \
    --to=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    /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.