OSDN Git Service

iio: mpu6050: improve code readability
authorH. Nikolaus Schaller <hns@goldelico.com>
Thu, 21 Feb 2019 17:02:54 +0000 (18:02 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 4 Apr 2019 19:19:48 +0000 (20:19 +0100)
- use temporary variable in get_mount_matrix()
- remove , after { }

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c

index 0692198..6138a6d 100644 (file)
@@ -796,12 +796,14 @@ static const struct iio_mount_matrix *
 inv_get_mount_matrix(const struct iio_dev *indio_dev,
                     const struct iio_chan_spec *chan)
 {
-       return &((struct inv_mpu6050_state *)iio_priv(indio_dev))->orientation;
+       struct inv_mpu6050_state *data = iio_priv(indio_dev);
+
+       return &data->orientation;
 }
 
 static const struct iio_chan_spec_ext_info inv_ext_info[] = {
        IIO_MOUNT_MATRIX(IIO_SHARED_BY_TYPE, inv_get_mount_matrix),
-       { },
+       { }
 };
 
 #define INV_MPU6050_CHAN(_type, _channel2, _index)                    \