• Andy Shevchenko's avatar
    serial: core: enforce type for upf_t when copying · a17e74c5
    Andy Shevchenko authored
    upf_t is a bitwise defined type and any assignment from different, but
    compatible, types makes static analyzer unhappy.
    
    drivers/tty/serial/serial_core.c:793:29: warning: incorrect type in assignment (different base types)
    drivers/tty/serial/serial_core.c:793:29:    expected int [signed] flags
    drivers/tty/serial/serial_core.c:793:29:    got restricted upf_t [usertype] flags
    drivers/tty/serial/serial_core.c:867:19: warning: incorrect type in assignment (different base types)
    drivers/tty/serial/serial_core.c:867:19:    expected restricted upf_t [usertype] new_flags
    drivers/tty/serial/serial_core.c:867:19:    got int [signed] flags
    
    Enforce corresponding types when upf_t being assigned.
    
    Note, we need __force attribute due to the scope of variable. It's being
    used in user space with plain old type while kernel uses bitwise one.
    Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    a17e74c5
serial_core.c 73.8 KB