lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 13 Jul 2022 09:56:58 -0500
From:   Carlos Bilbao <carlos.bilbao@....com>
To:     <bjorn.andersson@...aro.org>, <amitk@...nel.org>,
        <thara.gopinath@...il.com>, <konrad.dybcio@...ainline.org>
CC:     <agross@...nel.org>, <david.brown@...aro.org>,
        <linux-pm@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <bilbao@...edu>,
        Carlos Bilbao <carlos.bilbao@....com>
Subject: [PATCH 3/4] thermal/drivers/qcom: Simplify function calibrate_8960()

Simply function calibrate_8960() so a second check to IS_ERR(data) may be
avoided.

Signed-off-by: Carlos Bilbao <carlos.bilbao@....com>
---
 drivers/thermal/qcom/tsens-8960.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/thermal/qcom/tsens-8960.c b/drivers/thermal/qcom/tsens-8960.c
index f4fc8a1c161e..b41ff164e67a 100644
--- a/drivers/thermal/qcom/tsens-8960.c
+++ b/drivers/thermal/qcom/tsens-8960.c
@@ -205,10 +205,11 @@ static int calibrate_8960(struct tsens_priv *priv)
 	struct tsens_sensor *s = priv->sensor;
 
 	data = qfprom_read(priv->dev, "calib");
-	if (IS_ERR(data))
+	if (IS_ERR(data)) {
 		data = qfprom_read(priv->dev, "calib_backup");
-	if (IS_ERR(data))
-		return PTR_ERR(data);
+		if (IS_ERR(data))
+			return PTR_ERR(data);
+	}
 
 	for (i = 0; i < num_read; i++, s++)
 		s->offset = data[i];
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ