Skip to content
  • Peter Hurley's avatar
    serial: Fix upstat_t sparse warnings · d4260b51
    Peter Hurley authored
    Commit 299245a1
    
    ,
    serial: core: Privatize modem status enable flags, introduced
    the upstat_t type and matching bit definitions. The purpose is to
    produce sparse warnings if the wrong bit definitions are used
    (by warning of implicit integer conversions).
    
    Fix implicit conversion to integer return type from uart_cts_enabled()
    and uart_dcd_enabled().
    
    Fixes the following sparse warnings:
    drivers/tty/serial/serial_core.c:63:30: warning: incorrect type in return expression (different base types)
    drivers/tty/serial/serial_core.c:63:30:    expected int
    drivers/tty/serial/serial_core.c:63:30:    got restricted upstat_t
    include/linux/serial_core.h:364:30: warning: incorrect type in return expression (different base types)
    include/linux/serial_core.h:364:30:    expected bool
    include/linux/serial_core.h:364:30:    got restricted upstat_t
    include/linux/serial_core.h:364:30: warning: incorrect type in return expression (different base types)
    include/linux/serial_core.h:364:30:    expected bool
    include/linux/serial_core.h:364:30:    got restricted upstat_t
    
    Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com>
    Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    d4260b51