[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231115095407.1059704-1-suhui@nfschina.com>
Date: Wed, 15 Nov 2023 17:54:08 +0800
From: Su Hui <suhui@...china.com>
To: vkoul@...nel.org, yung-chuan.liao@...ux.intel.com,
pierre-louis.bossart@...ux.intel.com, sanyog.r.kale@...el.com,
nathan@...nel.org, ndesaulniers@...gle.com, trix@...hat.com
Cc: Su Hui <suhui@...china.com>, alsa-devel@...a-project.org,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
kernel-janitors@...r.kernel.org
Subject: [PATCH] soundwire: amd: add an error code check in amd_sdw_clock_stop_exit
Clang static analyzer complains that value stored to 'ret' is never read.
Add an error code check and print an error message if 'readl_poll_timeout'
failed.
Signed-off-by: Su Hui <suhui@...china.com>
---
drivers/soundwire/amd_manager.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c
index 3a99f6dcdfaf..f391b541f4b7 100644
--- a/drivers/soundwire/amd_manager.c
+++ b/drivers/soundwire/amd_manager.c
@@ -1029,6 +1029,10 @@ static int amd_sdw_clock_stop_exit(struct amd_sdw_manager *amd_manager)
ret = readl_poll_timeout(amd_manager->mmio + ACP_SW_CLK_RESUME_CTRL, val,
(val & AMD_SDW_CLK_RESUME_DONE), ACP_DELAY_US,
AMD_SDW_TIMEOUT);
+ if (ret)
+ dev_err(amd_manager->dev, "%s: timed out: %pe\n", __func__,
+ ERR_PTR(ret));
+
if (val & AMD_SDW_CLK_RESUME_DONE) {
writel(0, amd_manager->mmio + ACP_SW_CLK_RESUME_CTRL);
ret = sdw_bus_exit_clk_stop(&amd_manager->bus);
--
2.30.2
Powered by blists - more mailing lists