]> git.baikalelectronics.ru Git - kernel.git/commitdiff
iio: st_sensors: Drop unneeded explicit castings
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 13 Mar 2020 10:49:50 +0000 (12:49 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 21 Mar 2020 10:26:21 +0000 (10:26 +0000)
In few places the unnecessary explicit castings are being used.
Drop them for good.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/st_accel_buffer.c
drivers/iio/accel/st_accel_core.c
drivers/iio/common/st_sensors/st_sensors_core.c
drivers/iio/gyro/st_gyro_buffer.c
drivers/iio/gyro/st_gyro_core.c
drivers/iio/magnetometer/st_magn_core.c
drivers/iio/pressure/st_pressure_core.c

index 9f2b40474b8ec7fb9e36e382cd0beedd55a2299d..b5c814ef16379d85b4e3097fd7afc079b7158c92 100644 (file)
@@ -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;
 
index 5f7bdb1f55d16d0ce4137e2321094037ebceaa03..e2ec5d1274953beff0ec92fd9db339558766e1a8 100644 (file)
@@ -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)
index 0e35ff06f9af9d1d821411a679b2da9d497c0f85..c6f0bcb6d10f79e48a2cdf3c02185908063f6765 100644 (file)
@@ -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:
index 7465ad62391c09cab6d977f7194b7fae89232323..9c92ff7a82bee846dbf7b6bc9963bf418bcc60c8 100644 (file)
@@ -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;
 
index 26c50b24bc089b19c475e0f3e22407c94bf5a2ef..c8aa051995d3bf6d4a8fb4301f6ae09ee4d4538b 100644 (file)
@@ -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;
 
index e68184a93a6d5374b30b036004b3415609441411..79de721e60159cdc6d7b1271e1abac2dd492364a 100644 (file)
@@ -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);
index 8bb47c3b4d6b3c737890dd16120dfd221fbb00c4..789a2928504a729c73dd1f2d26a06756909cd7ef 100644 (file)
@@ -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;