summaryrefslogtreecommitdiff
path: root/drivers/i3c
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2025-01-07 10:02:03 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2025-01-12 23:55:50 +0100
commit5e8c732357ce0abe6251120d65f1ddbe5bc939fd (patch)
treefd095313826fffe4986bc097ff8313eaaa410367 /drivers/i3c
parente55905a3f33c5a87166ec5a1b1cb5cb0abc273ee (diff)
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>
Diffstat (limited to 'drivers/i3c')
-rw-r--r--drivers/i3c/master/i3c-master-cdns.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/i3c/master/i3c-master-cdns.c b/drivers/i3c/master/i3c-master-cdns.c
index fe4d59833ad5..8d69a34986d9 100644
--- a/drivers/i3c/master/i3c-master-cdns.c
+++ b/drivers/i3c/master/i3c-master-cdns.c
@@ -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;
}