[patch V4 27/31] serial: use parity8 in max3100

From: zengzhaoxiu
Date: Wed Jun 29 2016 - 13:28:41 EST


From: Zhaoxiu Zeng <zhaoxiu.zeng@xxxxxxxxx>

Use parity8(c) instead "hweight8(c) & 1" to improve readability,
and improve performance on some CPUs that without popcount support.

Signed-off-by: Zhaoxiu Zeng <zhaoxiu.zeng@xxxxxxxxx>
---
drivers/tty/serial/max3100.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c
index 5c4c280..a0cc84a 100644
--- a/drivers/tty/serial/max3100.c
+++ b/drivers/tty/serial/max3100.c
@@ -155,7 +155,7 @@ static int max3100_do_parity(struct max3100_port *s, u16 c)
else
c &= 0xff;

- parity = parity ^ (hweight8(c) & 1);
+ parity ^= parity8(c);
return parity;
}

--
2.7.4