public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: david laight <david.laight@runbox.com>
To: Nikolay Borisov <nik.borisov@suse.com>
Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org,
	bp@alien8.de, Yazen.Ghannam@amd.com
Subject: Re: [PATCH v2] RAS/AMD/ATL: Remove bitwise_xor_bits
Date: Tue, 25 Nov 2025 09:35:29 +0000	[thread overview]
Message-ID: <20251125093529.109c8e1e@pumpkin> (raw)
In-Reply-To: <20251124084011.1575166-1-nik.borisov@suse.com>

On Mon, 24 Nov 2025 10:40:11 +0200
Nikolay Borisov <nik.borisov@suse.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

      parent reply	other threads:[~2025-11-25  9:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-24  8:40 [PATCH v2] RAS/AMD/ATL: Remove bitwise_xor_bits Nikolay Borisov
2025-11-24  8:57 ` Kuan-Wei Chiu
2025-11-24 11:05   ` Borislav Petkov
2025-11-24 12:03     ` Kuan-Wei Chiu
2025-11-24 12:52       ` Borislav Petkov
2025-11-24 13:24         ` Nikolay Borisov
2025-11-24 13:34           ` Borislav Petkov
2025-11-25  9:35 ` david laight [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251125093529.109c8e1e@pumpkin \
    --to=david.laight@runbox.com \
    --cc=Yazen.Ghannam@amd.com \
    --cc=bp@alien8.de \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nik.borisov@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox