lkml.org 
[lkml]   [2008]   [May]   [13]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateTue, 13 May 2008 14:56:56 +0800
FromLi Zefan <>
Subject[PATCH] leds: fix unsigned value overflow in for loop
Fix the following unsigned variable overflow:
	unsigned i;
	for (i = n; i >= 0; i--)
	...

It won't break anything to use type 'int'.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 drivers/leds/leds-atmel-pwm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/leds/leds-atmel-pwm.c b/drivers/leds/leds-atmel-pwm.c
index 28db6c1..52297c3 100644
--- a/drivers/leds/leds-atmel-pwm.c
+++ b/drivers/leds/leds-atmel-pwm.c
@@ -37,7 +37,7 @@ static int __init pwmled_probe(struct platform_device *pdev)
 {
 	const struct gpio_led_platform_data	*pdata;
 	struct pwmled				*leds;
-	unsigned				i;
+	int					i;
 	int					status;
 
 	pdata = pdev->dev.platform_data;
-- 
1.5.4.rc3

\
 
 \ /
  Last update: 2008-05-13 09:01    [from the cache]
©2003-2008