History

tty: serial: Cleanup the bit shift with macro

This patch replaces the bit shift code with "_BITUL()" macro inside "serial_rs485" struct.

Crescent CY Hsieh committed 2 years ago

Commit 76ac8e21 parent d4303e01 file · +9 −8Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/linux/serial.h+9−8
@@ -11,6 +11,7 @@ · 10 unmodified lines
11#ifndef _UAPI_LINUX_SERIAL_H11#ifndef _UAPI_LINUX_SERIAL_H
12#define _UAPI_LINUX_SERIAL_H12#define _UAPI_LINUX_SERIAL_H
13 13
14#include <linux/const.h>
14#include <linux/types.h>15#include <linux/types.h>
15 16
16#include <linux/tty_flags.h>17#include <linux/tty_flags.h>
@@ -140,14 +141,14 @@ struct serial_icounter_struct { · 123 unmodified lines
140 */141 */
141struct serial_rs485 {142struct serial_rs485 {
142 __u32 flags;143 __u32 flags;
143#define SER_RS485_ENABLED (1 << 0)144#define SER_RS485_ENABLED _BITUL(0)
144#define SER_RS485_RTS_ON_SEND (1 << 1)145#define SER_RS485_RTS_ON_SEND _BITUL(1)
145#define SER_RS485_RTS_AFTER_SEND (1 << 2)146#define SER_RS485_RTS_AFTER_SEND _BITUL(2)
146#define SER_RS485_RX_DURING_TX (1 << 4)147#define SER_RS485_RX_DURING_TX _BITUL(3)
147#define SER_RS485_TERMINATE_BUS (1 << 5)148#define SER_RS485_TERMINATE_BUS _BITUL(4)
148#define SER_RS485_ADDRB (1 << 6)149#define SER_RS485_ADDRB _BITUL(5)
149#define SER_RS485_ADDR_RECV (1 << 7)150#define SER_RS485_ADDR_RECV _BITUL(6)
150#define SER_RS485_ADDR_DEST (1 << 8)151#define SER_RS485_ADDR_DEST _BITUL(7)
151 152
152 __u32 delay_rts_before_send;153 __u32 delay_rts_before_send;
153 __u32 delay_rts_after_send;154 __u32 delay_rts_after_send;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t