summaryrefslogtreecommitdiffstats
path: root/drivers/auxdisplay/img-ascii-lcd.c
diff options
context:
space:
mode:
authorMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>2018-02-19 16:47:52 +0100
committerMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>2018-03-13 18:16:38 +0100
commit26a2c54d03bd514fb3d3520706f911b3ca56b011 (patch)
tree8211aa3c62a6bf9d6f9f85626607d2c7978cd563 /drivers/auxdisplay/img-ascii-lcd.c
parentauxdisplay: img-ascii-lcd: Fix doc comment to silence warnings (diff)
downloadlinux-26a2c54d03bd514fb3d3520706f911b3ca56b011.tar.xz
linux-26a2c54d03bd514fb3d3520706f911b3ca56b011.zip
auxdisplay: img-ascii-lcd: Silence 2 uninitialized warnings
The warnings are: drivers/auxdisplay/img-ascii-lcd.c: warning: 'err' may be used uninitialized in this function [-Wuninitialized] At lines 109 and 207. Reported by Geert using the build service several times, e.g.: https://lkml.org/lkml/2018/2/19/303 They are two false positives, since num_chars > 0 in the three present configurations (boston, malta, sead3). Initialize to 0 in order to silence the warning. Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Paul Burton <paul.burton@mips.com> Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Diffstat (limited to '')
-rw-r--r--drivers/auxdisplay/img-ascii-lcd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/auxdisplay/img-ascii-lcd.c b/drivers/auxdisplay/img-ascii-lcd.c
index d8133024fd5d..834509506ef6 100644
--- a/drivers/auxdisplay/img-ascii-lcd.c
+++ b/drivers/auxdisplay/img-ascii-lcd.c
@@ -97,7 +97,7 @@ static struct img_ascii_lcd_config boston_config = {
static void malta_update(struct img_ascii_lcd_ctx *ctx)
{
unsigned int i;
- int err;
+ int err = 0;
for (i = 0; i < ctx->cfg->num_chars; i++) {
err = regmap_write(ctx->regmap,
@@ -180,7 +180,7 @@ static int sead3_wait_lcd_idle(struct img_ascii_lcd_ctx *ctx)
static void sead3_update(struct img_ascii_lcd_ctx *ctx)
{
unsigned int i;
- int err;
+ int err = 0;
for (i = 0; i < ctx->cfg->num_chars; i++) {
err = sead3_wait_lcd_idle(ctx);