[PATCH] leds: fix unsigned value overflow in for loop

From: Li Zefan
Date: Tue May 13 2008 - 02:58:34 EST


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@xxxxxxxxxxxxxx>
---
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/