Skip to content

Commit e80a7e7

Browse files
nathanchanceJassiBrar
authored andcommitted
mailbox: imx: Avoid using val uninitialized in imx_mu_isr()
Clang warns: drivers/mailbox/imx-mailbox.c:284:2: warning: variable 'val' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] default: ^~~~~~~ drivers/mailbox/imx-mailbox.c:288:7: note: uninitialized use occurs here if (!val) ^~~ drivers/mailbox/imx-mailbox.c:263:9: note: initialize the variable 'val' to silence this warning u32 val, ctrl; ^ = 0 1 warning generated. Prior to commit 91c8c1f ("mailbox: imx: add xSR/xCR register array"), val was always initialized in imx_mu_isr() but now, it is not initialized in the default case. Return IRQ_NONE like the statement below does and add a message that there is an unhandled type for this switch statement so that it can be updated. Fixes: 91c8c1f ("mailbox: imx: add xSR/xCR register array") Link: ClangBuiltLinux#1404 Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Jassi Brar <[email protected]>
1 parent 8a7cdb1 commit e80a7e7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/mailbox/imx-mailbox.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,9 @@ static irqreturn_t imx_mu_isr(int irq, void *p)
282282
(ctrl & IMX_MU_xCR_GIEn(priv->dcfg->type, cp->idx));
283283
break;
284284
default:
285-
break;
285+
dev_warn_ratelimited(priv->dev, "Unhandled channel type %d\n",
286+
cp->type);
287+
return IRQ_NONE;
286288
}
287289

288290
if (!val)

0 commit comments

Comments
 (0)