Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Kuan-Wei Chiu and committed by
Greg Kroah-Hartman
063a8964 857eec46

+2 -1
+2 -1
drivers/tty/serial/max3100.c
··· 16 16 /* 4 MAX3100s should be enough for everyone */ 17 17 #define MAX_MAX3100 4 18 18 19 + #include <linux/bitops.h> 19 20 #include <linux/container_of.h> 20 21 #include <linux/delay.h> 21 22 #include <linux/device.h> ··· 134 133 else 135 134 c &= 0xff; 136 135 137 - parity = parity ^ (hweight8(c) & 1); 136 + parity = parity ^ parity8(c); 138 137 return parity; 139 138 } 140 139