]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
iio: light: rpr0521 magic number to sizeof() on value read
authorMikko Koivunen <mikko.koivunen@fi.rohmeurope.com>
Thu, 18 May 2017 12:12:52 +0000 (15:12 +0300)
committerJonathan Cameron <jic23@kernel.org>
Sun, 21 May 2017 14:06:12 +0000 (15:06 +0100)
Changed magic number to sizeof() on value read.

Signed-off-by: Mikko Koivunen <mikko.koivunen@fi.rohmeurope.com>
Acked-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/light/rpr0521.c

index 9219819785986d05501c82df39b9743b24e63537..38095d79a87432087d82fd3756b457c35a6d5d23 100644 (file)
@@ -356,7 +356,7 @@ static int rpr0521_read_raw(struct iio_dev *indio_dev,
 
                ret = regmap_bulk_read(data->regmap,
                                       rpr0521_data_reg[chan->address].address,
-                                      &raw_data, 2);
+                                      &raw_data, sizeof(raw_data));
                if (ret < 0) {
                        rpr0521_set_power_state(data, false, device_mask);
                        mutex_unlock(&data->lock);