Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp149772ybb; Thu, 19 Mar 2020 18:32:54 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtU9wyvVSLaqk+9f7h9OonCnpr4XAw5UxaZBSzwgyGZSxTuxa7tcvp8lAQDE3KcjlCyEw1i X-Received: by 2002:aca:c3c1:: with SMTP id t184mr4725927oif.113.1584667974604; Thu, 19 Mar 2020 18:32:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584667974; cv=none; d=google.com; s=arc-20160816; b=NT0GAnrjtZDxDZ2EUOi5oZFt1j/cczA++3ckgr/d27+WgvyKHNSL5dPV5fU8x9kft/ J3+8Y9oPReyGccqfTjK84HJJA0AD4ocMbXWuDhBJhrsZmjhFsr4FrmM3ukcUMPZdDJ5/ TQ1TR7cJJKLWCEH1WUOfWNPPEFc9mpqx6Q9AkpoWK1FSbcyTOLiXMxLQGnj9V4nU1xSy oo9ieVbvdwLGdF7isdpEMPvauuKRgXxpveeNGfov4v/5VHeExmLRp8hZW4HgJY7kgTIB Fjedn147W7fFIXqR072ldai/X3kVcWP49Z0F8e8wnmCaR1NBfk08NgET0rCuKahxr3fg foww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=6dPRfwJ7cgKcFNpf9daUycuZejfvv9cfNkQo+Nh1n90=; b=bzs/RQPpcRX5gdCA8oAC8IMpi0sF8z0DmTQ/VK4GwjrNrgNiS+fvCiOFGoCIYiIrCw oUndIFTR+vrNVPPm+YY8ge96y31Qvy8K3jWucJ1PKh7kQdr+TCzk99o7LN1cj+XUy4kO HUGW07EgFuJ9uh+slwuBt2dJIkuZqLoOfuICgzPeMgcHZyLiXghldrF22ryhmyq+kaEX 0oAXM/Z7ZBBExakTCHjJLWup7coPYX8rHXsPd1KswZgFoM2PAvxzFY/2Xqbv/w3pl5Ab /eomHi7NIbFMVlzG/C4rHsdGmbVGCDHcM68sdSJyPHEA3mePnrJKPrz9OzPtV4ZPzwpP eT6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q1si2035985otm.71.2020.03.19.18.32.29; Thu, 19 Mar 2020 18:32:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727297AbgCTB2z (ORCPT + 99 others); Thu, 19 Mar 2020 21:28:55 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:12103 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727235AbgCTB2z (ORCPT ); Thu, 19 Mar 2020 21:28:55 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 8FDBE9DD9CCE3F553607; Fri, 20 Mar 2020 09:28:51 +0800 (CST) Received: from ubuntu.huawei.com (10.175.104.215) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.487.0; Fri, 20 Mar 2020 09:28:41 +0800 From: Chen Huang To: Santosh Shilimkar CC: Dave Gerlach , Arnd Bergmann , , , , Chen Huang Subject: [PATCH -next] soc: ti: pm33xx: Add a judgement for variable 'ret' Date: Fri, 20 Mar 2020 07:11:50 +0800 Message-ID: <20200319231150.28106-1-chenhuang5@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.104.215] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Chen Huang --- 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