mirror of https://gitee.com/openkylin/linux.git
serial: Fix sparse warnings in uart_throttle()/uart_unthrottle()
The struct uart_port.flags field is type upf_t, as are the matching bit definitions. Change local mask variable to type upf_t. Fixes sparse warnings: drivers/tty/serial/serial_core.c:620:22: warning: invalid assignment: |= drivers/tty/serial/serial_core.c:620:22: left side has type unsigned int drivers/tty/serial/serial_core.c:620:22: right side has type restricted upf_t drivers/tty/serial/serial_core.c:622:22: warning: invalid assignment: |= drivers/tty/serial/serial_core.c:622:22: left side has type unsigned int drivers/tty/serial/serial_core.c:622:22: right side has type restricted upf_t drivers/tty/serial/serial_core.c:624:17: warning: restricted upf_t degrades to integer drivers/tty/serial/serial_core.c:626:22: warning: invalid assignment: &= drivers/tty/serial/serial_core.c:626:22: left side has type unsigned int drivers/tty/serial/serial_core.c:626:22: right side has type restricted upf_t drivers/tty/serial/serial_core.c:629:20: warning: restricted upf_t degrades to integer drivers/tty/serial/serial_core.c:632:20: warning: restricted upf_t degrades to integer drivers/tty/serial/serial_core.c:643:22: warning: invalid assignment: |= drivers/tty/serial/serial_core.c:643:22: left side has type unsigned int drivers/tty/serial/serial_core.c:643:22: right side has type restricted upf_t drivers/tty/serial/serial_core.c:645:22: warning: invalid assignment: |= drivers/tty/serial/serial_core.c:645:22: left side has type unsigned int drivers/tty/serial/serial_core.c:645:22: right side has type restricted upf_t drivers/tty/serial/serial_core.c:647:17: warning: restricted upf_t degrades to integer drivers/tty/serial/serial_core.c:649:22: warning: invalid assignment: &= drivers/tty/serial/serial_core.c:649:22: left side has type unsigned int drivers/tty/serial/serial_core.c:649:22: right side has type restricted upf_t drivers/tty/serial/serial_core.c:652:20: warning: restricted upf_t degrades to integer drivers/tty/serial/serial_core.c:655:20: warning: restricted upf_t degrades to integer Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d4260b5169
commit
91f189de46
|
@ -618,7 +618,7 @@ static void uart_throttle(struct tty_struct *tty)
|
|||
{
|
||||
struct uart_state *state = tty->driver_data;
|
||||
struct uart_port *port = state->uart_port;
|
||||
uint32_t mask = 0;
|
||||
upf_t mask = 0;
|
||||
|
||||
if (I_IXOFF(tty))
|
||||
mask |= UPF_SOFT_FLOW;
|
||||
|
@ -641,7 +641,7 @@ static void uart_unthrottle(struct tty_struct *tty)
|
|||
{
|
||||
struct uart_state *state = tty->driver_data;
|
||||
struct uart_port *port = state->uart_port;
|
||||
uint32_t mask = 0;
|
||||
upf_t mask = 0;
|
||||
|
||||
if (I_IXOFF(tty))
|
||||
mask |= UPF_SOFT_FLOW;
|
||||
|
|
Loading…
Reference in New Issue