Re: [PATCH v2 00/10] x86/mce: Clean up some x86/mce code

From: Nikolay Borisov
Date: Thu Oct 17 2024 - 11:30:41 EST




On 16.10.24 г. 15:30 ч., Qiuxu Zhuo wrote:
1. Clean up some x86/mce code as below. No functional changes intended.

- Simplify some code.

- Remove some unnecessary code.

- Improve readability for some code.

- Fix some typos.

[ Reduce the text segment size by ~116 bytes. ]

2. Pass the following basic tests:

- Compile test.

- Correctable/uncorrectable memory errors can be notified via CMCI/MCE interrupts.

- Correctable/uncorrectable memory errors can be dispatched to the mcelog daemon and the EDAC driver.

[ Tested on an Intel Sapphire Rapids server. ]

3. This patch series is based on v6.12-rc3.

4. Changes in v2:

- Collect "Reviewed-by:" tags for patch {1-8,10}.

- Update the commit message of patch 9 to include the names of all
variables that don't need NULL pointer initializations.

Thanks Tony for reviewing this patch series.

Qiuxu Zhuo (10):
x86/mce/dev-mcelog: Use xchg() to get and clear the flags
x86/mce/intel: Use MCG_BANKCNT_MASK instead of 0xff
x86/mce: Make several functions return bool
x86/mce/threshold: Remove the redundant this_cpu_dec_return()
x86/mce/genpool: Make mce_gen_pool_create() return explicit error codes
x86/mce: Convert multiple if () statements into a switch() statement
x86/mce: Remove the unnecessary {}
x86/mce: Remove the redundant zeroing assignments
x86/mce/amd: Remove unnecessary NULL pointer initializations
x86/mce: Fix typos in comments

arch/x86/include/asm/mce.h | 4 +--
arch/x86/kernel/cpu/mce/amd.c | 18 +++++------
arch/x86/kernel/cpu/mce/core.c | 47 ++++++++++++++--------------
arch/x86/kernel/cpu/mce/dev-mcelog.c | 11 ++-----
arch/x86/kernel/cpu/mce/genpool.c | 8 ++---
arch/x86/kernel/cpu/mce/intel.c | 11 ++++---
arch/x86/kernel/cpu/mce/threshold.c | 2 +-
7 files changed, 46 insertions(+), 55 deletions(-)


base-commit: 8e929cb546ee42c9a61d24fae60605e9e3192354


Reviewed-by: Nikolay Borisov <nik.borisov@xxxxxxxx>