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: <20250908153221.383589-3-thorsten.blum@linux.dev>
Date: Mon,  8 Sep 2025 17:32:20 +0200
From: Thorsten Blum <thorsten.blum@...ux.dev>
To: Heiko Carstens <hca@...ux.ibm.com>,
	Vasily Gorbik <gor@...ux.ibm.com>,
	Alexander Gordeev <agordeev@...ux.ibm.com>,
	Christian Borntraeger <borntraeger@...ux.ibm.com>,
	Sven Schnelle <svens@...ux.ibm.com>,
	Thorsten Blum <thorsten.blum@...ux.dev>
Cc: linux-s390@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] s390/nmi: Simplify return statement in nmi_registers_valid()

Don't negate the 'mci.*' operands and use the logical AND operator to
simplify the return statement.

No functional changes intended.

Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
---
 arch/s390/kernel/nmi.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/s390/kernel/nmi.c b/arch/s390/kernel/nmi.c
index 11f33243a23f..cbefd6bde104 100644
--- a/arch/s390/kernel/nmi.c
+++ b/arch/s390/kernel/nmi.c
@@ -321,9 +321,7 @@ static bool notrace nmi_registers_valid(union mci mci)
 	cr2.reg = get_lowcore()->cregs_save_area[2];
 	if (cr2.gse && !mci.gs && !test_cpu_flag(CIF_MCCK_GUEST))
 		return false;
-	if (!mci.ms || !mci.pm || !mci.ia)
-		return false;
-	return true;
+	return mci.ms && mci.pm && mci.ia;
 }
 NOKPROBE_SYMBOL(nmi_registers_valid);
 
-- 
2.51.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ