linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] soc: ti: pm33xx: Add a judgement for variable 'ret'
@ 2020-03-19 23:11 Chen Huang
  0 siblings, 0 replies; only message in thread
From: Chen Huang @ 2020-03-19 23:11 UTC (permalink / raw)
  To: Santosh Shilimkar
  Cc: Dave Gerlach, Arnd Bergmann, linux-kernel, linux-arm-kernel,
	linux-next, Chen Huang

Variable 'ret' is the result whether sram has prepared to translate
to low power state. 0 represents preparation is successful, others
represent error code. If preparation failed, then return 'ret' to end
the function.

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/soc/ti/pm33xx.c: In function am33xx_do_sram_idle:
drivers/soc/ti/pm33xx.c:135:6: warning: variable ret set but not used [-Wunused-but-set-variable]

Fixes: commit 6afaff1c6624f ("soc: ti: pm33xx: Add base cpuidle support")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Chen Huang <chenhuang5@huawei.com>
---
 drivers/soc/ti/pm33xx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/soc/ti/pm33xx.c b/drivers/soc/ti/pm33xx.c
index de0123ec8ad6..a51ba770f1e3 100644
--- a/drivers/soc/ti/pm33xx.c
+++ b/drivers/soc/ti/pm33xx.c
@@ -139,6 +139,8 @@ static int am33xx_do_sram_idle(u32 wfi_flags)
 
 	if (wfi_flags & WFI_FLAG_WAKE_M3)
 		ret = m3_ipc->ops->prepare_low_power(m3_ipc, WKUP_M3_IDLE);
+	if (ret)
+		return ret;
 
 	return pm_ops->cpu_suspend(am33xx_do_wfi_sram, wfi_flags);
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-20  1:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-19 23:11 [PATCH -next] soc: ti: pm33xx: Add a judgement for variable 'ret' Chen Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).