All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] max8997_charger: Fix unsigned value for less than zero
@ 2011-10-28 22:56 ` jhbird.choi at gmail.com
  0 siblings, 0 replies; 2+ messages in thread
From: jhbird.choi @ 2011-10-28 22:56 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: MyungJoo Ham, Anton Vorontsov, Jonghwan Choi

From: Jonghwan Choi <jhbird.choi@gmail.com>

The 'val' is a 'unsigned char', so it is never less than zero.

Signed-off-by: Jonghwan Choi <jhbird.choi@gmail.com>
---
 drivers/power/max8997_charger.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/power/max8997_charger.c b/drivers/power/max8997_charger.c
index ffc5033..a5eb3ed 100644
--- a/drivers/power/max8997_charger.c
+++ b/drivers/power/max8997_charger.c
@@ -97,7 +97,7 @@ static __devinit int max8997_battery_probe(struct platform_device *pdev)
 		return -EINVAL;
 
 	if (pdata->eoc_mA) {
-		u8 val = (pdata->eoc_mA - 50) / 10;
+		int val = (pdata->eoc_mA - 50) / 10;
 		if (val < 0)
 			val = 0;
 		if (val > 0xf)
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] max8997_charger: Fix unsigned value for less than zero
@ 2011-10-28 22:56 ` jhbird.choi at gmail.com
  0 siblings, 0 replies; 2+ messages in thread
From: jhbird.choi at gmail.com @ 2011-10-28 22:56 UTC (permalink / raw)
  To: linux-arm-kernel

From: Jonghwan Choi <jhbird.choi@gmail.com>

The 'val' is a 'unsigned char', so it is never less than zero.

Signed-off-by: Jonghwan Choi <jhbird.choi@gmail.com>
---
 drivers/power/max8997_charger.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/power/max8997_charger.c b/drivers/power/max8997_charger.c
index ffc5033..a5eb3ed 100644
--- a/drivers/power/max8997_charger.c
+++ b/drivers/power/max8997_charger.c
@@ -97,7 +97,7 @@ static __devinit int max8997_battery_probe(struct platform_device *pdev)
 		return -EINVAL;
 
 	if (pdata->eoc_mA) {
-		u8 val = (pdata->eoc_mA - 50) / 10;
+		int val = (pdata->eoc_mA - 50) / 10;
 		if (val < 0)
 			val = 0;
 		if (val > 0xf)
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-28 22:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-28 22:56 [PATCH] max8997_charger: Fix unsigned value for less than zero jhbird.choi
2011-10-28 22:56 ` jhbird.choi at gmail.com

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.