summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorKuan-Wei Chiu <visitorckw@gmail.com>2025-05-15 11:13:11 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-05-21 14:37:22 +0300
commit063a896456c339fc181cbd04a08ce409b7866f83 (patch)
tree5d7e0cb08cf2bb3c617e44a283b0a94fa437e0ab /drivers/tty
parent857eec4678805d24391c17c9f3c4d9d21b63371e (diff)
downloadlinux-063a896456c339fc181cbd04a08ce409b7866f83.tar.xz
serial: max3100: Replace open-coded parity calculation with parity8()
Refactor parity calculations to use the standard parity8() helper. This change eliminates redundant implementations. Co-developed-by: Yu-Chun Lin <eleanor15x@gmail.com> Signed-off-by: Yu-Chun Lin <eleanor15x@gmail.com> Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com> Link: https://lore.kernel.org/r/20250515081311.775559-1-visitorckw@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/max3100.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c
index f2dd83692b2c..d28a2ebfa29f 100644
--- a/drivers/tty/serial/max3100.c
+++ b/drivers/tty/serial/max3100.c
@@ -16,6 +16,7 @@
/* 4 MAX3100s should be enough for everyone */
#define MAX_MAX3100 4
+#include <linux/bitops.h>
#include <linux/container_of.h>
#include <linux/delay.h>
#include <linux/device.h>
@@ -133,7 +134,7 @@ static int max3100_do_parity(struct max3100_port *s, u16 c)
else
c &= 0xff;
- parity = parity ^ (hweight8(c) & 1);
+ parity = parity ^ parity8(c);
return parity;
}