Skip to content

Commit 76ac8e2

Browse files
Crescent CY Hsiehgregkh
authored andcommitted
tty: serial: Cleanup the bit shift with macro
This patch replaces the bit shift code with "_BITUL()" macro inside "serial_rs485" struct. Signed-off-by: Crescent CY Hsieh <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d4303e0 commit 76ac8e2

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

include/uapi/linux/serial.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#ifndef _UAPI_LINUX_SERIAL_H
1212
#define _UAPI_LINUX_SERIAL_H
1313

14+
#include <linux/const.h>
1415
#include <linux/types.h>
1516

1617
#include <linux/tty_flags.h>
@@ -140,14 +141,14 @@ struct serial_icounter_struct {
140141
*/
141142
struct serial_rs485 {
142143
__u32 flags;
143-
#define SER_RS485_ENABLED (1 << 0)
144-
#define SER_RS485_RTS_ON_SEND (1 << 1)
145-
#define SER_RS485_RTS_AFTER_SEND (1 << 2)
146-
#define SER_RS485_RX_DURING_TX (1 << 4)
147-
#define SER_RS485_TERMINATE_BUS (1 << 5)
148-
#define SER_RS485_ADDRB (1 << 6)
149-
#define SER_RS485_ADDR_RECV (1 << 7)
150-
#define SER_RS485_ADDR_DEST (1 << 8)
144+
#define SER_RS485_ENABLED _BITUL(0)
145+
#define SER_RS485_RTS_ON_SEND _BITUL(1)
146+
#define SER_RS485_RTS_AFTER_SEND _BITUL(2)
147+
#define SER_RS485_RX_DURING_TX _BITUL(3)
148+
#define SER_RS485_TERMINATE_BUS _BITUL(4)
149+
#define SER_RS485_ADDRB _BITUL(5)
150+
#define SER_RS485_ADDR_RECV _BITUL(6)
151+
#define SER_RS485_ADDR_DEST _BITUL(7)
151152

152153
__u32 delay_rts_before_send;
153154
__u32 delay_rts_after_send;

0 commit comments

Comments
 (0)