diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-01-21 18:03:28 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-01-21 18:03:28 -0500 |
commit | 0077d45e46fe2af3aaee5813c99268afcd0e7c0e (patch) | |
tree | 3de13b52930e350f93523fb3c84c0b8fb4a7e7fb /include | |
parent | 27ae7a7435634820e7f7e2b922d8119f79cfc6e4 (diff) |
[SERIAL] Make uart_port flags a bitwise type
Same reasoning as commit 747c8a55946ed037bf7d62454c3c599c02af2262
but this time we're making uart_port flags a bitwise type - not
all of these flags correspond with the old ASYNC_ flags, so there
is the possibility for bugs if the wrong ASYNC_* constants are
used. Always use UPF_* constants for uart_port->flags.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/serial_8250.h | 2 | ||||
-rw-r--r-- | include/linux/serial_core.h | 48 |
2 files changed, 26 insertions, 24 deletions
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index cee302aefdb7..73b464f0926a 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
@@ -26,7 +26,7 @@ struct plat_serial8250_port { | |||
26 | unsigned char regshift; /* register shift */ | 26 | unsigned char regshift; /* register shift */ |
27 | unsigned char iotype; /* UPIO_* */ | 27 | unsigned char iotype; /* UPIO_* */ |
28 | unsigned char hub6; | 28 | unsigned char hub6; |
29 | unsigned int flags; /* UPF_* flags */ | 29 | upf_t flags; /* UPF_* flags */ |
30 | }; | 30 | }; |
31 | 31 | ||
32 | /* | 32 | /* |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 1a8cd0169c9a..4041122dabfc 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -203,6 +203,8 @@ struct uart_icount { | |||
203 | __u32 buf_overrun; | 203 | __u32 buf_overrun; |
204 | }; | 204 | }; |
205 | 205 | ||
206 | typedef unsigned int __bitwise__ upf_t; | ||
207 | |||
206 | struct uart_port { | 208 | struct uart_port { |
207 | spinlock_t lock; /* port lock */ | 209 | spinlock_t lock; /* port lock */ |
208 | unsigned int iobase; /* in/out[bwl] */ | 210 | unsigned int iobase; /* in/out[bwl] */ |
@@ -230,29 +232,29 @@ struct uart_port { | |||
230 | unsigned long sysrq; /* sysrq timeout */ | 232 | unsigned long sysrq; /* sysrq timeout */ |
231 | #endif | 233 | #endif |
232 | 234 | ||
233 | unsigned int flags; | 235 | upf_t flags; |
234 | 236 | ||
235 | #define UPF_FOURPORT (1 << 1) | 237 | #define UPF_FOURPORT ((__force upf_t) (1 << 1)) |
236 | #define UPF_SAK (1 << 2) | 238 | #define UPF_SAK ((__force upf_t) (1 << 2)) |
237 | #define UPF_SPD_MASK (0x1030) | 239 | #define UPF_SPD_MASK ((__force upf_t) (0x1030)) |
238 | #define UPF_SPD_HI (0x0010) | 240 | #define UPF_SPD_HI ((__force upf_t) (0x0010)) |
239 | #define UPF_SPD_VHI (0x0020) | 241 | #define UPF_SPD_VHI ((__force upf_t) (0x0020)) |
240 | #define UPF_SPD_CUST (0x0030) | 242 | #define UPF_SPD_CUST ((__force upf_t) (0x0030)) |
241 | #define UPF_SPD_SHI (0x1000) | 243 | #define UPF_SPD_SHI ((__force upf_t) (0x1000)) |
242 | #define UPF_SPD_WARP (0x1010) | 244 | #define UPF_SPD_WARP ((__force upf_t) (0x1010)) |
243 | #define UPF_SKIP_TEST (1 << 6) | 245 | #define UPF_SKIP_TEST ((__force upf_t) (1 << 6)) |
244 | #define UPF_AUTO_IRQ (1 << 7) | 246 | #define UPF_AUTO_IRQ ((__force upf_t) (1 << 7)) |
245 | #define UPF_HARDPPS_CD (1 << 11) | 247 | #define UPF_HARDPPS_CD ((__force upf_t) (1 << 11)) |
246 | #define UPF_LOW_LATENCY (1 << 13) | 248 | #define UPF_LOW_LATENCY ((__force upf_t) (1 << 13)) |
247 | #define UPF_BUGGY_UART (1 << 14) | 249 | #define UPF_BUGGY_UART ((__force upf_t) (1 << 14)) |
248 | #define UPF_MAGIC_MULTIPLIER (1 << 16) | 250 | #define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16)) |
249 | #define UPF_CONS_FLOW (1 << 23) | 251 | #define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) |
250 | #define UPF_SHARE_IRQ (1 << 24) | 252 | #define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) |
251 | #define UPF_BOOT_AUTOCONF (1 << 28) | 253 | #define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) |
252 | #define UPF_IOREMAP (1 << 31) | 254 | #define UPF_IOREMAP ((__force upf_t) (1 << 31)) |
253 | 255 | ||
254 | #define UPF_CHANGE_MASK (0x17fff) | 256 | #define UPF_CHANGE_MASK ((__force upf_t) (0x17fff)) |
255 | #define UPF_USR_MASK (UPF_SPD_MASK|UPF_LOW_LATENCY) | 257 | #define UPF_USR_MASK ((__force upf_t) (UPF_SPD_MASK|UPF_LOW_LATENCY)) |
256 | 258 | ||
257 | unsigned int mctrl; /* current modem ctrl settings */ | 259 | unsigned int mctrl; /* current modem ctrl settings */ |
258 | unsigned int timeout; /* character-based timeout */ | 260 | unsigned int timeout; /* character-based timeout */ |