Skip to content

Commit 26a2c54

Browse files
committed
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 <[email protected]> Cc: Paul Burton <[email protected]> Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 6a78b4d commit 26a2c54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/auxdisplay/img-ascii-lcd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static struct img_ascii_lcd_config boston_config = {
9797
static void malta_update(struct img_ascii_lcd_ctx *ctx)
9898
{
9999
unsigned int i;
100-
int err;
100+
int err = 0;
101101

102102
for (i = 0; i < ctx->cfg->num_chars; i++) {
103103
err = regmap_write(ctx->regmap,
@@ -180,7 +180,7 @@ static int sead3_wait_lcd_idle(struct img_ascii_lcd_ctx *ctx)
180180
static void sead3_update(struct img_ascii_lcd_ctx *ctx)
181181
{
182182
unsigned int i;
183-
int err;
183+
int err = 0;
184184

185185
for (i = 0; i < ctx->cfg->num_chars; i++) {
186186
err = sead3_wait_lcd_idle(ctx);

0 commit comments

Comments
 (0)