提交 1093736b 编写于 作者: V Vasiliy Kulikov 提交者: Linus Torvalds

drivers/misc/apds9802als.c: fix signedness bug

i2c_smbus_read_byte_data() may return negative error code.  This is not
seen to als_sensing_range_store() as the result is stored in unsigned int.

Made it signed.
Signed-off-by: NVasiliy Kulikov <segooon@gmail.com>
Cc: Hong Liu <hong.liu@intel.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Anantha Narayanan <anantha.narayanan@intel.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 90482e45
...@@ -123,7 +123,7 @@ static ssize_t als_sensing_range_store(struct device *dev, ...@@ -123,7 +123,7 @@ static ssize_t als_sensing_range_store(struct device *dev,
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct als_data *data = i2c_get_clientdata(client); struct als_data *data = i2c_get_clientdata(client);
unsigned int ret_val; int ret_val;
unsigned long val; unsigned long val;
if (strict_strtoul(buf, 10, &val)) if (strict_strtoul(buf, 10, &val))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册