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]
Message-ID: <20220217141609.119453-3-Smita.KoralahalliChannabasappa@amd.com>
Date:   Thu, 17 Feb 2022 08:16:09 -0600
From:   Smita Koralahalli <Smita.KoralahalliChannabasappa@....com>
To:     <x86@...nel.org>, <linux-edac@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
CC:     Tony Luck <tony.luck@...el.com>, "H . Peter Anvin" <hpa@...or.com>,
        "Dave Hansen" <dave.hansen@...ux.intel.com>,
        Yazen Ghannam <yazen.ghannam@....com>,
        Smita Koralahalli <Smita.KoralahalliChannabasappa@....com>
Subject: [RFC PATCH 2/2] x86/mce: Simplify code in log_and_reset_block()

Reuse the existing _reset_block() to reset the threshold block after
logging error in log_and_reset_block().

Signed-off-by: Smita Koralahalli <Smita.KoralahalliChannabasappa@....com>
---
 arch/x86/kernel/cpu/mce/amd.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/x86/kernel/cpu/mce/amd.c b/arch/x86/kernel/cpu/mce/amd.c
index 53d9320d1470..823733468973 100644
--- a/arch/x86/kernel/cpu/mce/amd.c
+++ b/arch/x86/kernel/cpu/mce/amd.c
@@ -960,7 +960,6 @@ static void log_error_thresholding(unsigned int bank, u64 misc)
 
 static void log_and_reset_block(struct threshold_block *block)
 {
-	struct thresh_restart tr;
 	u32 low = 0, high = 0;
 
 	if (!block)
@@ -976,9 +975,7 @@ static void log_and_reset_block(struct threshold_block *block)
 	log_error_thresholding(block->bank, ((u64)high << 32) | low);
 
 	/* Reset threshold block after logging error. */
-	memset(&tr, 0, sizeof(tr));
-	tr.b = block;
-	threshold_restart_bank(&tr);
+	_reset_block(block);
 }
 
 /*
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ