Skip to contentSkip to conversation

leds: fix unsigned value overflow in for loop

PATCH New Li Zefan 1 participant 1 message May 13, 2008

Subsystems (2)
lore
Share & tools
lore

Li Zefan

author
#0 lore raw

PATCH 1/1 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'.

---
 drivers/leds/leds-atmel-pwm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/leds/leds-atmel-pwm.c +1 -1
index 28db6c1..52297c3 100644
@@ -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;
Signature · 1 line
1.5.4.rc3