]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
iio: bmi160: use variable names for sizeof() operator
authorAlison Schofield <amsfield22@gmail.com>
Mon, 16 Jan 2017 05:01:10 +0000 (21:01 -0800)
committerJonathan Cameron <jic23@kernel.org>
Sat, 21 Jan 2017 13:06:03 +0000 (13:06 +0000)
Replace the types with the actual variable names when using the
sizeof() operator.  This is kernel preferred style as it's
more obvious that it is correct.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/imu/bmi160/bmi160_core.c

index 5355507f8fa1493c8fc5346e4f51da37f8f4790c..1e7c88bdf47249d38cbc4a01c661ad6147c435cc 100644 (file)
@@ -338,9 +338,9 @@ static int bmi160_get_data(struct bmi160_data *data, int chan_type,
        __le16 sample;
        enum bmi160_sensor_type t = bmi160_to_sensor(chan_type);
 
-       reg = bmi160_regs[t].data + (axis - IIO_MOD_X) * sizeof(__le16);
+       reg = bmi160_regs[t].data + (axis - IIO_MOD_X) * sizeof(sample);
 
-       ret = regmap_bulk_read(data->regmap, reg, &sample, sizeof(__le16));
+       ret = regmap_bulk_read(data->regmap, reg, &sample, sizeof(sample));
        if (ret < 0)
                return ret;
 
@@ -405,8 +405,8 @@ static irqreturn_t bmi160_trigger_handler(int irq, void *p)
 
        for_each_set_bit(i, indio_dev->active_scan_mask,
                         indio_dev->masklength) {
-               ret = regmap_bulk_read(data->regmap, base + i * sizeof(__le16),
-                                      &sample, sizeof(__le16));
+               ret = regmap_bulk_read(data->regmap, base + i * sizeof(sample),
+                                      &sample, sizeof(sample));
                if (ret < 0)
                        goto done;
                buf[j++] = sample;