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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210624074223.11372-1-tangbin@cmss.chinamobile.com>
Date:   Thu, 24 Jun 2021 15:42:23 +0800
From:   Tang Bin <tangbin@...s.chinamobile.com>
To:     linux@...linux.org.uk
Cc:     linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Tang Bin <tangbin@...s.chinamobile.com>
Subject: [PATCH] ARM: bL_switcher: use IS_ERR_OR_NULL() to simplify code

Use IS_ERR_OR_NULL() instead of IS_ERR() to simplify code.

Signed-off-by: Tang Bin <tangbin@...s.chinamobile.com>
---
 arch/arm/common/bL_switcher.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/arm/common/bL_switcher.c b/arch/arm/common/bL_switcher.c
index 9a9aa5354..b8e8e2567 100644
--- a/arch/arm/common/bL_switcher.c
+++ b/arch/arm/common/bL_switcher.c
@@ -352,11 +352,9 @@ int bL_switch_request_cb(unsigned int cpu, unsigned int new_cluster_id,
 
 	t = &bL_threads[cpu];
 
-	if (IS_ERR(t->task))
-		return PTR_ERR(t->task);
-	if (!t->task)
-		return -ESRCH;
-
+	if (IS_ERR_OR_NULL(t->task))
+		return t->task ? PTR_ERR(t->task) : -ESRCH;
+
 	spin_lock(&t->lock);
 	if (t->completer) {
 		spin_unlock(&t->lock);
-- 
2.20.1.windows.1



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ