Thread (2 messages) 2 messages, 2 authors, 2012-02-02

[patch] backlight: lp855x_bl: silence a compiler warning

STALE5359d

From: Dan Carpenter <hidden>
Date: 2012-02-01 14:39:10
Also in: kernel-janitors
Subsystem: backlight class/subsystem, framebuffer layer, the rest · Maintainers: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller, Linus Torvalds

Gcc 4.6.2 complains that "end" can be used without being initialized:

drivers/video/backlight/lp855x_bl.c: In function ‘lp855x_init_registers’:
drivers/video/backlight/lp855x_bl.c:78:32: warning: ‘end’ may be used uninitialized in this function [-Wuninitialized]
drivers/video/backlight/lp855x_bl.c:67:12: note: ‘end’ was declared here

I've modified the function to return invalid if we don't recognize the
id string.

Signed-off-by: Dan Carpenter <redacted>
diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c
index 8f628b8..5e8153d 100644
--- a/drivers/video/backlight/lp855x_bl.c
+++ b/drivers/video/backlight/lp855x_bl.c
@@ -73,6 +73,8 @@ static int lp855x_is_valid_rom_area(struct lp855x *lp, u8 addr)
 	} else if (strstr(id, "lp8556")) {
 		start = EPROM_START;
 		end = EPROM_END;
+	} else {
+		return 0;
 	}
 
 	return (addr >= start && addr <= end) ? 1 : 0;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help