提交 8386dd50 编写于 作者: B Brian Masney 提交者: Jonathan Cameron

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: NBrian Masney <masneyb@onstation.org>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 1ad51360
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册