summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasiliy Kulikov <segooon@gmail.com>2010-11-11 23:05:11 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2010-11-12 16:55:31 +0100
commit1093736b3c34319b8f1825a4423414d9cf397d73 (patch)
treef1b491b897e5f25b4677b440966add568892b2db
parentmisc/isl29020: signedness bug in als_sensing_range_store() (diff)
downloadlinux-1093736b3c34319b8f1825a4423414d9cf397d73.tar.xz
linux-1093736b3c34319b8f1825a4423414d9cf397d73.zip
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: Vasiliy 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: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/misc/apds9802als.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/apds9802als.c b/drivers/misc/apds9802als.c
index f9b91ba8900c..0ed09358027e 100644
--- a/drivers/misc/apds9802als.c
+++ b/drivers/misc/apds9802als.c
@@ -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))