Skip to content

Commit

Permalink
i3c: cdns: use parity8 helper instead of open coding it
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wolfram Sang authored and Alexandre Belloni committed Jan 12, 2025
1 parent e55905a commit 5e8c732
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/i3c/master/i3c-master-cdns.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,8 +889,7 @@ static u32 prepare_rr0_dev_address(u32 addr)
ret |= (addr & GENMASK(9, 7)) << 6;

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

return ret;
}
Expand Down

0 comments on commit 5e8c732

Please sign in to comment.