From: Bryan Chan <bchimhim15@gmail.com>
To: Tony Luck <tony.luck@intel.com>, Borislav Petkov <bp@alien8.de>,
linux-edac@vger.kernel.org (open list:EDAC-SKYLAKE),
linux-kernel@vger.kernel.org (open list)
Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org,
Bryan Chan <bchimhim15@gmail.com>
Subject: [PATCH] EDAC/skx_base: Fix ambiguous bitwise and logical operator style
Date: Wed, 23 Sep 2026 00:18:53 +0100 [thread overview]
Message-ID: <20260922231854.108188-1-bchimhim15@gmail.com> (raw)
The code works fine and works how it should be, the fix is just for
uniformity/consistency of the bitwise operations. Also fix the compiler
warning.
lchan here is always 0 or 1 here, replace the inconsistance logical
operator by xor operation resulting 1 or 2. This remove the compiler
warning and make the switch case easier for reading.
Signed-off-by: Bryan Chan <bchimhim15@gmail.com>
---
drivers/edac/skx_base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/edac/skx_base.c b/drivers/edac/skx_base.c
index de749413ff9a..ae2fda006632 100644
--- a/drivers/edac/skx_base.c
+++ b/drivers/edac/skx_base.c
@@ -356,7 +356,7 @@ static bool skx_sad_decode(struct decoded_addr *res)
break;
case 2:
lchan = (addr >> shift) % 2;
- lchan = (lchan << 1) | !lchan;
+ lchan = (lchan << 1) | (lchan ^ 1);
break;
case 3:
lchan = ((addr >> shift) % 2) << 1;
--
2.55.0
next reply other threads:[~2026-09-22 23:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 23:18 Bryan Chan [this message]
2026-09-23 0:20 ` Luck, Tony
2026-09-23 3:47 ` Bryan Chan
2026-09-23 16:35 ` Luck, Tony
2026-09-23 16:56 ` Bryan Chan
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=20260922231854.108188-1-bchimhim15@gmail.com \
--to=bchimhim15@gmail.com \
--cc=bp@alien8.de \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.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
all inboxes | Powered by JetHome®