public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] backlight: lp855x_bl: silence a compiler warning
@ 2012-02-01 14:39 Dan Carpenter
  2012-02-02  1:21 ` Kim, Milo
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-02-01 14:39 UTC (permalink / raw)
  To: linux-fbdev

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 <dan.carpenter@oracle.com>

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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-02-02  1:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-01 14:39 [patch] backlight: lp855x_bl: silence a compiler warning Dan Carpenter
2012-02-02  1:21 ` Kim, Milo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox