iio: Remove unnecessary casts for iio_push_to_buffers()

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>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
Lars-Peter Clausen 2013-09-15 17:50:00 +01:00 committed by Jonathan Cameron
parent 5d65d92045
commit 8c60c7e75d
13 changed files with 25 additions and 21 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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:

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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;