Commit 1093736b authored by Vasiliy Kulikov's avatar Vasiliy Kulikov Committed by 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: default avatarVasiliy 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 90482e45
......@@ -123,7 +123,7 @@ static ssize_t als_sensing_range_store(struct device *dev,
{
struct i2c_client *client = to_i2c_client(dev);
struct als_data *data = i2c_get_clientdata(client);
unsigned int ret_val;
int ret_val;
unsigned long val;
if (strict_strtoul(buf, 10, &val))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment