2022-06-21 13:36:58

by Ilpo Järvinen

[permalink] [raw]
Subject: [PATCH v2 0/6] serial: A few cleanups

Here are a few cleanup to semi-random things I've come across while
reading the code.

The series had initially only patches 3-6 but then msm_serial exploded
during build because of redefining UART_SCR so I had to resolve the
namespace conflict. It would have probably being avoided if there would
have been linux/serial_reg.h but it was recently ruled out:

https://lore.kernel.org/lkml/CAPDyKFqHLQ8YTc3wzaFOdAA7Ay9RBEfdQC5uN574=oMavi6iCQ@mail.gmail.com/t/

(Now there would 3 items already in serial_reg.h already but it would
leave only async_icount into serial.h so the same problem in other
file).

v2:
- Fix commit summary line prefix

Ilpo Järvinen (6):
serial: msm: Convert container_of UART_TO_MSM to static inline
serial: msm: Rename UART_* defines to MSM_UART_*
serial: Use bits for UART_LSR_BRK_ERROR_BITS/MSR_ANY_DELTA
serial: 8250: Use C99 array initializer & define UART_REG_UNMAPPED
serial: Use UART_XMIT_SIZE
serial: Consolidate BOTH_EMPTY use

arch/mips/ath79/early_printk.c | 9 +-
drivers/accessibility/speakup/serialio.h | 3 +-
drivers/tty/amiserial.c | 18 +-
drivers/tty/mips_ejtag_fdc.c | 2 +-
drivers/tty/serial/8250/8250_early.c | 4 +-
drivers/tty/serial/8250/8250_port.c | 50 +--
drivers/tty/serial/meson_uart.c | 2 +-
drivers/tty/serial/msm_serial.c | 550 ++++++++++++-----------
drivers/tty/serial/omap-serial.c | 7 +-
drivers/tty/serial/owl-uart.c | 2 +-
drivers/tty/serial/pch_uart.c | 7 +-
drivers/tty/serial/pxa.c | 5 +-
drivers/tty/serial/rda-uart.c | 2 +-
drivers/tty/serial/sunsu.c | 4 +-
drivers/tty/serial/vr41xx_siu.c | 4 +-
include/linux/serial.h | 15 +-
include/linux/serial_core.h | 1 +
include/uapi/linux/serial_reg.h | 4 +-
18 files changed, 343 insertions(+), 346 deletions(-)

--
2.30.2


2022-06-21 13:37:04

by Ilpo Järvinen

[permalink] [raw]
Subject: [PATCH v2 3/6] serial: Use bits for UART_LSR_BRK_ERROR_BITS/MSR_ANY_DELTA

Instead of listing the bits for UART_LSR_BRK_ERROR_BITS and
UART_MSR_ANY_DELTA in comment, use them to define instead.

Signed-off-by: Ilpo Järvinen <[email protected]>
---
include/uapi/linux/serial_reg.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/serial_reg.h b/include/uapi/linux/serial_reg.h
index f51bc8f36813..bab3b39266cc 100644
--- a/include/uapi/linux/serial_reg.h
+++ b/include/uapi/linux/serial_reg.h
@@ -139,7 +139,7 @@
#define UART_LSR_PE 0x04 /* Parity error indicator */
#define UART_LSR_OE 0x02 /* Overrun error indicator */
#define UART_LSR_DR 0x01 /* Receiver data ready */
-#define UART_LSR_BRK_ERROR_BITS 0x1E /* BI, FE, PE, OE bits */
+#define UART_LSR_BRK_ERROR_BITS (UART_LSR_BI|UART_LSR_FE|UART_LSR_PE|UART_LSR_OE)

#define UART_MSR 6 /* In: Modem Status Register */
#define UART_MSR_DCD 0x80 /* Data Carrier Detect */
@@ -150,7 +150,7 @@
#define UART_MSR_TERI 0x04 /* Trailing edge ring indicator */
#define UART_MSR_DDSR 0x02 /* Delta DSR */
#define UART_MSR_DCTS 0x01 /* Delta CTS */
-#define UART_MSR_ANY_DELTA 0x0F /* Any of the delta bits! */
+#define UART_MSR_ANY_DELTA (UART_MSR_DDCD|UART_MSR_TERI|UART_MSR_DDSR|UART_MSR_DCTS)

#define UART_SCR 7 /* I/O: Scratch Register */

--
2.30.2

2022-06-23 08:09:53

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH v2 3/6] serial: Use bits for UART_LSR_BRK_ERROR_BITS/MSR_ANY_DELTA

On 21. 06. 22, 14:49, Ilpo Järvinen wrote:
> Instead of listing the bits for UART_LSR_BRK_ERROR_BITS and
> UART_MSR_ANY_DELTA in comment, use them to define instead.
>
> Signed-off-by: Ilpo Järvinen <[email protected]>

Reviewed-by: Jiri Slaby <[email protected]>


--
js