Commit 8386dd50 authored by Brian Masney's avatar Brian Masney Committed by Jonathan Cameron
Browse files

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: default avatarBrian Masney <masneyb@onstation.org>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 1ad51360
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -582,7 +582,7 @@ static ssize_t in_illuminance_lux_table_store(struct device *dev,

	/* Zero out the table */
	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;