mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
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 <bchimhim15@gmail.com> Signed-off-by: Tony Luck <tony.luck@intel.com> Link: https://patch.msgid.link/20260922231854.108188-1-bchimhim15@gmail.com
This commit is contained in:
parent
f0d8c34b3b
commit
cfc77cf89f
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user