Skip to content

Commit 5e8c732

Browse files
Wolfram Sangalexandrebelloni
authored andcommitted
i3c: cdns: use parity8 helper instead of open coding it
The kernel has now a generic helper for getting parity with easier to understand semantics. Make use of it. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20250107090204.6593-6-wsa+renesas@sang-engineering.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent e55905a commit 5e8c732

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/i3c/master/i3c-master-cdns.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,8 +889,7 @@ static u32 prepare_rr0_dev_address(u32 addr)
889889
ret |= (addr & GENMASK(9, 7)) << 6;
890890

891891
/* RR0[0] = ~XOR(addr[6:0]) */
892-
if (!(hweight8(addr & 0x7f) & 1))
893-
ret |= 1;
892+
ret |= parity8(addr & 0x7f) ? 0 : BIT(0);
894893

895894
return ret;
896895
}

0 commit comments

Comments
 (0)