staging: iio: tsl2583: don't assume an unsigned int is 32 bits
in_illuminance_lux_table_store assumes that an unsigned int is 32 bits. Replace this with sizeof(value[1]). Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
1ad513604f
commit
8386dd50a7
|
@ -582,7 +582,7 @@ static ssize_t in_illuminance_lux_table_store(struct device *dev,
|
||||||
|
|
||||||
/* Zero out the table */
|
/* Zero out the table */
|
||||||
memset(tsl2583_device_lux, 0, sizeof(tsl2583_device_lux));
|
memset(tsl2583_device_lux, 0, sizeof(tsl2583_device_lux));
|
||||||
memcpy(tsl2583_device_lux, &value[1], value[0] * 4);
|
memcpy(tsl2583_device_lux, &value[1], value[0] * sizeof(value[1]));
|
||||||
|
|
||||||
ret = len;
|
ret = len;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue