hwmon: jz4740: fix signedness bug
PATCH 1/2 hwmon: jz4740: fix signedness bug
wait_for_completion_interruptible_timeout() may return negative value. In this case, checking if (t > 0) will return true if t is unsigned.
--- drivers/hwmon/jz4740-hwmon.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/hwmon/jz4740-hwmon.c +1 -1
@@ -59,7 +59,7 @@ static ssize_t jz4740_hwmon_read_adcin(struct device *dev, {struct jz4740_hwmon *hwmon =dev_get_drvdata (dev);struct completion *completion = &hwmon->read_completion; -unsigned long t; +long t;unsigned long val;int ret;
Signature · 9 lines
1.7.5.4 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
PATCH 2/2 jz4740-battery: fix signedness bug
wait_for_completion_interruptible_timeout() may return negative value. In this case, checking if (t > 0) will return true if t is unsigned.
--- drivers/power/jz4740-battery.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/power/jz4740-battery.c +1 -1
@@ -67,7 +67,7 @@ static irqreturn_t jz_battery_irq_handler(int irq, void *devid)static long jz_battery_read_voltage (struct jz_battery *battery) { -unsigned long t; +long t;unsigned long val;long voltage;
Signature · 1 line
1.7.5.4
Re: [PATCH 2/2] jz4740-battery: fix signedness bug
Quoted 4 lines · Axel Lin
wait_for_completion_interruptible_timeout()may return negative value. In this case, checking if (t > 0) will return true if t is unsigned.Signed-off-by Axel Lin <[email protected]>
Thanks
Quoted 17 lines
--- drivers/power/jz4740-battery.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/power/jz4740-battery.c +1
-1@@ -67,7 +67,7 @@ static irqreturn_t jz_battery_irq_handler(int irq, void *devid)static long jz_battery_read_voltage (struct jz_battery *battery) { -unsigned long t; +long t;unsigned long val;long voltage;
Anton Vorontsov
AppliedRe: [PATCH 2/2] jz4740-battery: fix signedness bug
Quoted 7 lines · Lars-Peter Clausen
Quoted 4 lines · Axel Lin
wait_for_completion_interruptible_timeout()may return negative value. In this case, checking if (t > 0) will return true if t is unsigned.Signed-off-by Axel Lin <[email protected]>
Applied, thanks!
Signature · 2 lines
Anton Vorontsov Email: [email protected]
Quoted 4 lines · Axel Lin
wait_for_completion_interruptible_timeout()may return negative value. In this case, checking if (t > 0) will return true if t is unsigned.Signed-off-by Axel Lin <[email protected]>
Thanks
Quoted 17 lines
--- drivers/hwmon/jz4740-hwmon.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/hwmon/jz4740-hwmon.c +1
-1@@ -59,7 +59,7 @@ static ssize_t jz4740_hwmon_read_adcin(struct device *dev, {struct jz4740_hwmon *hwmon =dev_get_drvdata (dev);struct completion *completion = &hwmon->read_completion; -unsigned long t; +long t;unsigned long val;int ret;
Guenter Roeck
AppliedQuoted 4 lines · Axel Lin
wait_for_completion_interruptible_timeout()may return negative value. In this case, checking if (t > 0) will return true if t is unsigned.Signed-off-by Axel Lin <[email protected]>
Applied.
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors