diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-01-21 17:50:36 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-01-21 17:50:36 -0500 |
commit | 747c8a55946ed037bf7d62454c3c599c02af2262 (patch) | |
tree | 4c20f97a7700da30efa6e6e5f88ca13fe2b8470c | |
parent | ba899dbc036d24ab6b45faf64e3648a268721cc9 (diff) |
[SERIAL] Make uart_info flags a bitwise type
The potential for confusing the flags is fairly high. Make
uart_info's flags a bitwise type so sparse can check that the
right flag definitions are used with the right structure.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | include/linux/serial_core.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index b74ff34469b9..90f681789a64 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -287,6 +287,9 @@ struct uart_state { | |||
287 | }; | 287 | }; |
288 | 288 | ||
289 | #define UART_XMIT_SIZE PAGE_SIZE | 289 | #define UART_XMIT_SIZE PAGE_SIZE |
290 | |||
291 | typedef unsigned int __bitwise__ uif_t; | ||
292 | |||
290 | /* | 293 | /* |
291 | * This is the state information which is only valid when the port | 294 | * This is the state information which is only valid when the port |
292 | * is open; it may be freed by the core driver once the device has | 295 | * is open; it may be freed by the core driver once the device has |
@@ -296,17 +299,16 @@ struct uart_state { | |||
296 | struct uart_info { | 299 | struct uart_info { |
297 | struct tty_struct *tty; | 300 | struct tty_struct *tty; |
298 | struct circ_buf xmit; | 301 | struct circ_buf xmit; |
299 | unsigned int flags; | 302 | uif_t flags; |
300 | 303 | ||
301 | /* | 304 | /* |
302 | * These are the flags that specific to info->flags, and reflect our | 305 | * Definitions for info->flags. These are _private_ to serial_core, and |
303 | * internal state. They can not be accessed via port->flags. Low | 306 | * are specific to this structure. They may be queried by low level drivers. |
304 | * level drivers must not change these, but may query them instead. | ||
305 | */ | 307 | */ |
306 | #define UIF_CHECK_CD (1 << 25) | 308 | #define UIF_CHECK_CD ((__force uif_t) (1 << 25)) |
307 | #define UIF_CTS_FLOW (1 << 26) | 309 | #define UIF_CTS_FLOW ((__force uif_t) (1 << 26)) |
308 | #define UIF_NORMAL_ACTIVE (1 << 29) | 310 | #define UIF_NORMAL_ACTIVE ((__force uif_t) (1 << 29)) |
309 | #define UIF_INITIALIZED (1 << 31) | 311 | #define UIF_INITIALIZED ((__force uif_t) (1 << 31)) |
310 | 312 | ||
311 | int blocked_open; | 313 | int blocked_open; |
312 | 314 | ||