Re: [PATCH v2] RAS/AMD/ATL: Remove bitwise_xor_bits
From: david laight
Date: Tue Nov 25 2025 - 04:35:54 EST
On Mon, 24 Nov 2025 10:40:11 +0200
Nikolay Borisov <nik.borisov@xxxxxxxx> wrote:
> Both LLVM/GCC support a __builtin_parity function which is functionally
> equivalent to the custom bitwise_xor_bits() one. Let's simplify the code by
> relying on the built-in. No functional changes.
>
While you've got this code out on the operating table:
- Change all the locals/parameters from u8/u16 to 'unsigned int'.
It will generate better code.
Using u8/u16 only makes any sense if you are trying to reduce the
size of a structure.
- Both col_xor and row_xor are masks (for the parity code).
So the names are wrong.
In fact I think all the 'xor' and 'XOR' are incorrectly named.
- How often is 'xor_enable' aka 'mask_enable' set?
If set most of the time (or the code rarely runs) then if the hardware
register says 'don't include these values' then just set the row/col
mask values to zero and let the rest of the code just run through.
David