[PATCH] EDAC/skx_base: Fix ambiguous bitwise and logical operator style
From: Bryan Chan
Date: Tue Sep 22 2026 - 19:19:16 EST
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@xxxxxxxxx>
---
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