[RFC PATCH 2/2] x86/mce: Simplify code in log_and_reset_block()

Smita Koralahalli
2022-02-17T14:16:34Z

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@amd.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