From cfc77cf89fa9cf29474fb90c02e44a4c546e5378 Mon Sep 17 00:00:00 2001 From: Bryan Chan Date: Wed, 23 Sep 2026 00:18:53 +0100 Subject: EDAC/skx_base: Fix ambiguous bitwise and logical operator style The code works fine and works how it should be, the fix is just for uniformity/consistency of the bitwise operations and to fix a sparse warning: drivers/edac/skx_base.c:359:46: warning: dubious: x | !y lchan here is always 0 or 1 here, replace the inconsistent logical operator by xor operation. This removes the sparse warning and makes the switch case easier to read. [Tony: updated commit grammar and s/compiler warning/sparse warning/] Signed-off-by: Bryan Chan Signed-off-by: Tony Luck Link: https://patch.msgid.link/20260922231854.108188-1-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 @@ sad_found: break; case 2: lchan = (addr >> shift) % 2; - lchan = (lchan << 1) | !lchan; + lchan = (lchan << 1) | (lchan ^ 1); break; case 3: lchan = ((addr >> shift) % 2) << 1; -- cgit v1.2.3