]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
tty: serial: Fix bit order in RS485 flag definitions
authorChristoph Niedermaier <cniedermaier@dh-electronics.com>
Fri, 19 Jan 2024 11:35:16 +0000 (12:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jan 2024 02:15:24 +0000 (18:15 -0800)
Since the commit 93f3350c46fa ("RS485: fix inconsistencies in the
meaning of some variables"), the definition for bit 3 has been removed.
But with the switch to bit shift macros in commit 76ac8e29855b ("tty:
serial: Cleanup the bit shift with macro"), this gap wasn't preserved.
To avoid a break in user/kernel api of the system skip bit 3 again and
add a placeholder comment.

Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Fixes: 76ac8e29855b ("tty: serial: Cleanup the bit shift with macro")
Fixes: 6056f20f27e9 ("tty: serial: Add RS422 flag to struct serial_rs485")
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Crescent CY Hsieh <crescentcy.hsieh@moxa.com>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Lukas Wunner <lukas@wunner.de>
Cc: Lino Sanfilippo <l.sanfilippo@kunbus.com>
Cc: Hugo Villeneuve <hugo@hugovil.com>
Link: https://lore.kernel.org/r/20240119113516.2944-1-cniedermaier@dh-electronics.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/uapi/linux/serial.h

index 9086367db0435365689d1f8cbe2a9693958df401..de9b4733607e6b61b08ff7089ff90070168ff4a2 100644 (file)
@@ -145,12 +145,13 @@ struct serial_rs485 {
 #define SER_RS485_ENABLED              _BITUL(0)
 #define SER_RS485_RTS_ON_SEND          _BITUL(1)
 #define SER_RS485_RTS_AFTER_SEND       _BITUL(2)
-#define SER_RS485_RX_DURING_TX         _BITUL(3)
-#define SER_RS485_TERMINATE_BUS                _BITUL(4)
-#define SER_RS485_ADDRB                        _BITUL(5)
-#define SER_RS485_ADDR_RECV            _BITUL(6)
-#define SER_RS485_ADDR_DEST            _BITUL(7)
-#define SER_RS485_MODE_RS422           _BITUL(8)
+/* Placeholder for bit 3: SER_RS485_RTS_BEFORE_SEND, which isn't used anymore */
+#define SER_RS485_RX_DURING_TX         _BITUL(4)
+#define SER_RS485_TERMINATE_BUS                _BITUL(5)
+#define SER_RS485_ADDRB                        _BITUL(6)
+#define SER_RS485_ADDR_RECV            _BITUL(7)
+#define SER_RS485_ADDR_DEST            _BITUL(8)
+#define SER_RS485_MODE_RS422           _BITUL(9)
 
        __u32   delay_rts_before_send;
        __u32   delay_rts_after_send;