Skip to contentSkip to conversation

soc: ti: pm33xx: Add a judgement for variable 'ret'

PATCH New Chen Huang 1 participant 1 message Mar 20, 2020

Subsystems (2)
lore
Share & tools
lore

Chen Huang

author
#0 lore raw

PATCH 1/1 soc: ti: pm33xx: Add a judgement for variable 'ret'

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")
---
 drivers/soc/ti/pm33xx.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/soc/ti/pm33xx.c +2 -0
index de0123ec8ad6..a51ba770f1e3 100644
@@ -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);
 }
Signature · 1 line
2.17.1