Skip to content

Commit

Permalink
auxdisplay: img-ascii-lcd: Silence 2 uninitialized warnings
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Paul Burton <[email protected]>
Signed-off-by: Miguel Ojeda <[email protected]>
  • Loading branch information
ojeda committed Mar 13, 2018
1 parent 6a78b4d commit 26a2c54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/auxdisplay/img-ascii-lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 26a2c54

Please sign in to comment.