From: Dan Carpenter <dan.carpenter@oracle.com>
To: linux-fbdev@vger.kernel.org
Subject: [patch] backlight: lp855x_bl: silence a compiler warning
Date: Wed, 01 Feb 2012 14:39:10 +0000 [thread overview]
Message-ID: <20120201143910.GA5359@elgon.mountain> (raw)
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;
next reply other threads:[~2012-02-01 14:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-01 14:39 Dan Carpenter [this message]
2012-02-02 1:21 ` [patch] backlight: lp855x_bl: silence a compiler warning Kim, Milo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120201143910.GA5359@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=linux-fbdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox