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-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 25 Dec 2023 18:38:11 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: linux-edac@...r.kernel.org, kernel-janitors@...r.kernel.org,
 Borislav Petkov <bp@...en8.de>, James Morse <james.morse@....com>,
 Mauro Carvalho Chehab <mchehab@...nel.org>, Robert Richter
 <rric@...nel.org>, Tony Luck <tony.luck@...el.com>,
 Yazen Ghannam <yazen.ghannam@....com>
Cc: LKML <linux-kernel@...r.kernel.org>, cocci@...ia.fr,
 Muralidhara M K <muralidhara.mk@....com>
Subject: [PATCH 3/7] EDAC/amd64: Merge two if statements into one in
 amd64_edac_init()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Mon, 25 Dec 2023 16:45:37 +0100

Two if statements were connected with the same return statements.
Thus merge their condition checks into one statement.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 drivers/edac/amd64_edac.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 8a27a4af7121..49f3d9b54902 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -4406,10 +4406,7 @@ static int __init amd64_edac_init(void)
 	if (owner && strncmp(owner, EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
 		return -EBUSY;

-	if (!x86_match_cpu(amd64_cpuids))
-		return -ENODEV;
-
-	if (!amd_nb_num())
+	if (!x86_match_cpu(amd64_cpuids) || !amd_nb_num())
 		return -ENODEV;

 	opstate_init();
--
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ