iio: Remove unnecessary casts for iio_push_to_buffers()
authorLars-Peter Clausen <lars@metafoo.de>
Sun, 15 Sep 2013 16:50:00 +0000 (17:50 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sun, 15 Sep 2013 18:05:07 +0000 (19:05 +0100)
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>
13 files changed:
drivers/iio/accel/bma180.c
drivers/iio/accel/hid-sensor-accel-3d.c
drivers/iio/adc/ad7266.c
drivers/iio/adc/ad7298.c
drivers/iio/adc/ad7923.c
drivers/iio/adc/ad_sigma_delta.c
drivers/iio/adc/at91_adc.c
drivers/iio/gyro/hid-sensor-gyro-3d.c
drivers/iio/gyro/itg3200_buffer.c
drivers/iio/light/adjd_s311.c
drivers/iio/light/hid-sensor-als.c
drivers/iio/light/tcs3472.c
drivers/iio/magnetometer/hid-sensor-magn-3d.c

index 12e32e6b41037c334c1eb8b3cef0e70145f8d228..3eff2469dba94cd01b7393b1ab6b1a58b3541171 100644 (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);
 
index 46d22f3fb1a9bb0c3fb2259b6399fd1642d107d7..dcda17395c4e68f31f3382cd0c393a5845b025c5 100644 (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;
index 371731df1634b97a471f51fd67f1a8fbbddef091..5bfed2398b7080f580de80fbf7884cb70f66fc9f 100644 (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);
index 85d1481c312f67b1d84208f9003e04c0a9ee6891..0812556c11ff7b3bca12798395132422ab52ecbd 100644 (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);
index 4108dbb28c3d8edfa1b2e20134cf65e38951d55d..7eb4cb5a7f0d8c0659fbd048a3593c6a736178c4 100644 (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);
index f0d6335ae08760d418f56ced0eaec227772fa1ce..78d276f40c8e133fa012761301e993451e30259e 100644 (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;
index 84be63bdf0382b6b44dfa14ff818e72377baf779..6da5ebb25502193f5e8d16b42d0472a7a673eddf 100644 (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);
 
index c688d974d3e3ec3d858a4f07e6dabf592866a395..ea01c6bcfb56825979efc7bfc588eeb9e429e059 100644 (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;
index 6c43af9bb0a4474097f2def7ec15d973a7238b47..6b3c30118c484af1082206186e27fdcd3d67f2ee 100644 (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:
index c0da351b1c2edd8470093e0ce97c071befb83b98..c9c8b002b27d72b6d07276651fd32aa9bd9f2cc8 100644 (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);
index e59d00c3139c00c15f44e4ab14c844341d9663e5..fa6ae8cf89eaa9edfdfffe379939bc7cc8a491f0 100644 (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;
index dc7d8234134f687a663d06a0b7a7a8207f6b9327..7bf296943745b4d6e09a1d15f8c3028b28b26609 100644 (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);
index a98460b15e4b63fc791494c32b1594993a12b6d1..2634920562fb7263bad4ac9d8c6c75fe7a434b49 100644 (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;