All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] hwmon: (w83793) Clean up a signedness issue
@ 2013-10-19  9:12 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2013-10-19  9:12 UTC (permalink / raw)
  To: kernel-janitors

We cap the upper bound of "mtimeout" but since it's signed we should
check for negative values as well.  The mistake is harmless.  But I have
changed it to unsigned as a cleanup.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c
index b6470ec..9d63d71 100644
--- a/drivers/hwmon/w83793.c
+++ b/drivers/hwmon/w83793.c
@@ -1199,7 +1199,8 @@ static void w83793_init_client(struct i2c_client *client)
 
 static int watchdog_set_timeout(struct w83793_data *data, int timeout)
 {
-	int ret, mtimeout;
+	unsigned int mtimeout;
+	int ret;
 
 	mtimeout = DIV_ROUND_UP(timeout, 60);
 

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

* [lm-sensors] [patch] hwmon: (w83793) Clean up a signedness issue
@ 2013-10-19  9:12 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2013-10-19  9:12 UTC (permalink / raw)
  To: kernel-janitors

We cap the upper bound of "mtimeout" but since it's signed we should
check for negative values as well.  The mistake is harmless.  But I have
changed it to unsigned as a cleanup.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c
index b6470ec..9d63d71 100644
--- a/drivers/hwmon/w83793.c
+++ b/drivers/hwmon/w83793.c
@@ -1199,7 +1199,8 @@ static void w83793_init_client(struct i2c_client *client)
 
 static int watchdog_set_timeout(struct w83793_data *data, int timeout)
 {
-	int ret, mtimeout;
+	unsigned int mtimeout;
+	int ret;
 
 	mtimeout = DIV_ROUND_UP(timeout, 60);
 

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [patch] hwmon: (w83793) Clean up a signedness issue
  2013-10-19  9:12 ` [lm-sensors] " Dan Carpenter
@ 2013-10-19 16:06   ` Guenter Roeck
  -1 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2013-10-19 16:06 UTC (permalink / raw)
  To: kernel-janitors

On 10/19/2013 02:12 AM, Dan Carpenter wrote:
> We cap the upper bound of "mtimeout" but since it's signed we should
> check for negative values as well.  The mistake is harmless.  But I have
> changed it to unsigned as a cleanup.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
Applied to -next.

Thanks,
Guenter



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

* Re: [lm-sensors] [patch] hwmon: (w83793) Clean up a signedness issue
@ 2013-10-19 16:06   ` Guenter Roeck
  0 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2013-10-19 16:06 UTC (permalink / raw)
  To: kernel-janitors

On 10/19/2013 02:12 AM, Dan Carpenter wrote:
> We cap the upper bound of "mtimeout" but since it's signed we should
> check for negative values as well.  The mistake is harmless.  But I have
> changed it to unsigned as a cleanup.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
Applied to -next.

Thanks,
Guenter



_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

end of thread, other threads:[~2013-10-19 16:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-19  9:12 [patch] hwmon: (w83793) Clean up a signedness issue Dan Carpenter
2013-10-19  9:12 ` [lm-sensors] " Dan Carpenter
2013-10-19 16:06 ` Guenter Roeck
2013-10-19 16:06   ` [lm-sensors] " Guenter Roeck

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.