提交 bba42776 编写于 作者: A Andreas Ruprecht 提交者: Greg Kroah-Hartman

Staging: iio/accel: Changed data type of mask in store_measurement_mode() to u8

In sca3000_store_measurement_mode() we parse a value from a string
buffer via kstrtou8, and store the parsed value into a u8 after
and-ing it with mask.

As we are only interested in the lowest two bits here and mask is
initialized with a fixed value 0x03, mask may as well be a u8.
Signed-off-by: NAndreas Ruprecht <rupran@einserver.de>
Acked-by: NJonathan Cameron <jic23@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 0c9d1964
...@@ -382,7 +382,7 @@ sca3000_store_measurement_mode(struct device *dev, ...@@ -382,7 +382,7 @@ sca3000_store_measurement_mode(struct device *dev,
struct iio_dev *indio_dev = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct sca3000_state *st = iio_priv(indio_dev); struct sca3000_state *st = iio_priv(indio_dev);
int ret; int ret;
int mask = 0x03; u8 mask = 0x03;
u8 val; u8 val;
mutex_lock(&st->lock); mutex_lock(&st->lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册