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]
Date:   Sun,  9 Dec 2018 15:01:42 +0000
From:   Colin King <colin.king@...onical.com>
To:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        "H . Peter Anvin" <hpa@...or.com>, x86@...nel.org,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] x86/platform/olpc: remove duplicated check on node == -1

From: Colin Ian King <colin.king@...onical.com>

Currently the node == -1 check is being performed twice, the
second check is redundant and can be removed.  Fix this by
removing the redundant second check and moving the first check
into a combined check with the result from the olpc_ofw call.

Detected by cppcheck:
Identical condition '(s32)node==-1', second condition is always false

Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
 arch/x86/platform/olpc/olpc_dt.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/x86/platform/olpc/olpc_dt.c b/arch/x86/platform/olpc/olpc_dt.c
index b4ab779f1d47..658363ec3ff3 100644
--- a/arch/x86/platform/olpc/olpc_dt.c
+++ b/arch/x86/platform/olpc/olpc_dt.c
@@ -28,10 +28,7 @@ static phandle __init olpc_dt_getsibling(phandle node)
 	const void *args[] = { (void *)node };
 	void *res[] = { &node };
 
-	if ((s32)node == -1)
-		return 0;
-
-	if (olpc_ofw("peer", args, res) || (s32)node == -1)
+	if (((s32)node == -1) || olpc_ofw("peer", args, res))
 		return 0;
 
 	return node;
-- 
2.19.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ