Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4036813pxj; Mon, 21 Jun 2021 12:00:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNeU95bSsPCjFMjcZ+ZuQYkqL8L4zFPmlA4yB9AwegdR8FNmrM9UrjJSOCzB9wuZUX9FR+ X-Received: by 2002:a17:906:546:: with SMTP id k6mr26459857eja.53.1624302055464; Mon, 21 Jun 2021 12:00:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624302055; cv=none; d=google.com; s=arc-20160816; b=C/VQGWQBw6pSZfRp1ozHDfj27AfPEYTjnfGHw/sTlGLVyyDz99EqmAna6+ENnJloza pK65+cpesoOk6pkxe1dcTLe7TRM4DjK6Uzidh9Zgq7lSmrbREkIrYLOKUnWLO/ZMdbdH HZh9JCMh9TQ6KcgXPdkfwAfJsKxmpN4p7dsJiORHIUBPlgwxO7K2X6Ze+jOedBqyVfAf 6cVW2LI4CQFbdAzBeW5iLv9uv3AZwlhh18rEva5ccFljuvehCz4IDd+JS3J0Uxhq9Hhe C81T92NXmk+lteUQcLYLo1MXCvAo2DnycoewvbUgsghWCWGs9ygHdcaN2n8q5iLqB9Vw f6Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=/ygmZYU+MG2byTMVpaiprOTUIHyykhwgUiXgax26SdA=; b=thlXTZQrKkQwh0PFEaacHDZco3BVnK+lB1O4pnJYshPjtR4VpV3GoUz3x9eleY+dL/ H6Ue8p/n7Y0PMjwd6rlfbZanY0pdQknvlHmhoDZwYp+LSi+qXEBKQ7t3PqxxbolOKRTd ojQ98CtigK6L5w1lRHEjgNDkzUSmUJ1Zv1UjRNd+E/DqRVuTPuoBT0Mg9U1p8OPN1Gqc SJZY15so2KViAgTZRw+/vU+6p9k6q3o1G5NqDt8d7Rg0zbjtY0Q38d2Lvsnhd4Qfs9IT nsPiOA5S/J0Gj34nFdu0J+qEkN5a7hVJI1tIszumiJbbd11tEMyilruADPYRrqgRGYYr +vmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BHt813KO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ia10si11910988ejc.180.2021.06.21.12.00.32; Mon, 21 Jun 2021 12:00:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BHt813KO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230439AbhFUS72 (ORCPT + 99 others); Mon, 21 Jun 2021 14:59:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:44696 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229887AbhFUS71 (ORCPT ); Mon, 21 Jun 2021 14:59:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 328A660FD8; Mon, 21 Jun 2021 18:57:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624301833; bh=lrJ17/MH7b8ugVfwgmUtFvEv2k5HUdeVJM3WvbL5QVk=; h=From:To:Cc:Subject:Date:From; b=BHt813KOyCGvKpnDMnw6vkE4oYv7xjlVboBOPJqz8kM+XtcylgclvhdneW78VEavH w3vIuetjtB2wV2DLzRLyoZs85UPlYnj9XuuEBv6MR4RUPMs1R2ScEH/ai48XFG/ciC 1dYzj8J/VVhOD3Oq7NZQjqKFdtL1AfkZg0W373ZG3aF4qwIKvYLnbpOHQ2ZuxKyGFW r5rmZQexTl/Q3ULa1miPPEqLaEE/wJ385jTh+/qleuPhbaBMB4XLp/0HR8W/McD6FF QQubcCOtnxfb44u40Wxj8CG8nRpskQJe8hgluFqZUWsbmYFqf9Z7wr4tu2OKmrAOfk 1E1fwu2a51I5A== From: Nathan Chancellor To: Jassi Brar , Peng Fan Cc: Shawn Guo , Sascha Hauer , kernel@pengutronix.de, Fabio Estevam , linux-imx@nxp.com, Nick Desaulniers , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH] mailbox: imx: Avoid using val uninitialized in imx_mu_isr() Date: Mon, 21 Jun 2021 11:56:45 -0700 Message-Id: <20210621185645.2373845-1-nathan@kernel.org> X-Mailer: git-send-email 2.32.0.93.g670b81a890 MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 91c8c1fbe498 ("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: 91c8c1fbe498 ("mailbox: imx: add xSR/xCR register array") Link: https://github.com/ClangBuiltLinux/linux/issues/1404 Signed-off-by: Nathan Chancellor --- drivers/mailbox/imx-mailbox.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c index bc51bd3c1999..0ce75c6b36b6 100644 --- a/drivers/mailbox/imx-mailbox.c +++ b/drivers/mailbox/imx-mailbox.c @@ -282,7 +282,9 @@ static irqreturn_t imx_mu_isr(int irq, void *p) (ctrl & IMX_MU_xCR_GIEn(priv->dcfg->type, cp->idx)); break; default: - break; + dev_warn_ratelimited(priv->dev, "Unhandled channel type %d\n", + cp->type); + return IRQ_NONE; } if (!val) base-commit: 6393989e2a31914bdc50211ff350dade6c729ea7 -- 2.32.0.93.g670b81a890