All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] leds: fix unsigned value overflow in for loop
@ 2008-05-13  6:56 Li Zefan
  0 siblings, 0 replies; only message in thread
From: Li Zefan @ 2008-05-13  6:56 UTC (permalink / raw)
  To: rpurdie; +Cc: LKML

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-05-13  6:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-13  6:56 [PATCH] leds: fix unsigned value overflow in for loop Li Zefan

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.