Skip to content

Commit 1f06f57

Browse files
amboargregkh
authored andcommitted
serial: 8250: Use BIT(x) for UART_{CAP,BUG}_*
BIT(x) improves readability and safety with respect to shifts. Reviewed-by: Jiri Slaby <[email protected]> Signed-off-by: Andrew Jeffery <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent df8f2be commit 1f06f57

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

drivers/tty/serial/8250/8250.h

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* Copyright (C) 2001 Russell King.
88
*/
99

10+
#include <linux/bits.h>
1011
#include <linux/serial_8250.h>
1112
#include <linux/serial_reg.h>
1213
#include <linux/dmaengine.h>
@@ -70,25 +71,25 @@ struct serial8250_config {
7071
unsigned int flags;
7172
};
7273

73-
#define UART_CAP_FIFO (1 << 8) /* UART has FIFO */
74-
#define UART_CAP_EFR (1 << 9) /* UART has EFR */
75-
#define UART_CAP_SLEEP (1 << 10) /* UART has IER sleep */
76-
#define UART_CAP_AFE (1 << 11) /* MCR-based hw flow control */
77-
#define UART_CAP_UUE (1 << 12) /* UART needs IER bit 6 set (Xscale) */
78-
#define UART_CAP_RTOIE (1 << 13) /* UART needs IER bit 4 set (Xscale, Tegra) */
79-
#define UART_CAP_HFIFO (1 << 14) /* UART has a "hidden" FIFO */
80-
#define UART_CAP_RPM (1 << 15) /* Runtime PM is active while idle */
81-
#define UART_CAP_IRDA (1 << 16) /* UART supports IrDA line discipline */
82-
#define UART_CAP_MINI (1 << 17) /* Mini UART on BCM283X family lacks:
74+
#define UART_CAP_FIFO BIT(8) /* UART has FIFO */
75+
#define UART_CAP_EFR BIT(9) /* UART has EFR */
76+
#define UART_CAP_SLEEP BIT(10) /* UART has IER sleep */
77+
#define UART_CAP_AFE BIT(11) /* MCR-based hw flow control */
78+
#define UART_CAP_UUE BIT(12) /* UART needs IER bit 6 set (Xscale) */
79+
#define UART_CAP_RTOIE BIT(13) /* UART needs IER bit 4 set (Xscale, Tegra) */
80+
#define UART_CAP_HFIFO BIT(14) /* UART has a "hidden" FIFO */
81+
#define UART_CAP_RPM BIT(15) /* Runtime PM is active while idle */
82+
#define UART_CAP_IRDA BIT(16) /* UART supports IrDA line discipline */
83+
#define UART_CAP_MINI BIT(17) /* Mini UART on BCM283X family lacks:
8384
* STOP PARITY EPAR SPAR WLEN5 WLEN6
8485
*/
8586

86-
#define UART_BUG_QUOT (1 << 0) /* UART has buggy quot LSB */
87-
#define UART_BUG_TXEN (1 << 1) /* UART has buggy TX IIR status */
88-
#define UART_BUG_NOMSR (1 << 2) /* UART has buggy MSR status bits (Au1x00) */
89-
#define UART_BUG_THRE (1 << 3) /* UART has buggy THRE reassertion */
90-
#define UART_BUG_PARITY (1 << 4) /* UART mishandles parity if FIFO enabled */
91-
#define UART_BUG_TXRACE (1 << 5) /* UART Tx fails to set remote DR */
87+
#define UART_BUG_QUOT BIT(0) /* UART has buggy quot LSB */
88+
#define UART_BUG_TXEN BIT(1) /* UART has buggy TX IIR status */
89+
#define UART_BUG_NOMSR BIT(2) /* UART has buggy MSR status bits (Au1x00) */
90+
#define UART_BUG_THRE BIT(3) /* UART has buggy THRE reassertion */
91+
#define UART_BUG_PARITY BIT(4) /* UART mishandles parity if FIFO enabled */
92+
#define UART_BUG_TXRACE BIT(5) /* UART Tx fails to set remote DR */
9293

9394

9495
#ifdef CONFIG_SERIAL_8250_SHARE_IRQ

0 commit comments

Comments
 (0)