[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251125093529.109c8e1e@pumpkin>
Date: Tue, 25 Nov 2025 09:35:29 +0000
From: david laight <david.laight@...box.com>
To: Nikolay Borisov <nik.borisov@...e.com>
Cc: linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org, bp@...en8.de,
Yazen.Ghannam@....com
Subject: Re: [PATCH v2] RAS/AMD/ATL: Remove bitwise_xor_bits
On Mon, 24 Nov 2025 10:40:11 +0200
Nikolay Borisov <nik.borisov@...e.com> 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
Powered by blists - more mailing lists