This patch replaces the bit shift code with "_BITUL()" macro inside "serial_rs485" struct.
Showing the changes to include/uapi (1 of 1 file). Show all
Unified · Split
| @@ -11,6 +11,7 @@ · 10 unmodified lines | ||
| 11 | 11 | #ifndef _UAPI_LINUX_SERIAL_H |
| 12 | 12 | #define _UAPI_LINUX_SERIAL_H |
| 13 | 13 | |
| 14 | +#include <linux/const.h> | |
| 14 | 15 | #include <linux/types.h> |
| 15 | 16 | |
| 16 | 17 | #include <linux/tty_flags.h> |
| @@ -140,14 +141,14 @@ struct serial_icounter_struct { · 123 unmodified lines | ||
| 140 | 141 | */ |
| 141 | 142 | struct serial_rs485 { |
| 142 | 143 | __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) | |
| 151 | 152 | |
| 152 | 153 | __u32 delay_rts_before_send; |
| 153 | 154 | __u32 delay_rts_after_send; |