• Paul Gortmaker's avatar
    8250_pci: fix warnings in backport of Broadcom TruManage support · 82a938ab
    Paul Gortmaker authored
    commit 7400ce7e (v3.4.92-76-g7400ce7e)
    was a backport of commit ebebd49a upstream
    ("8250/16?50: Add support for Broadcom TruManage redirected serial port")
    
    However, in the context of 3.4.x kernels, the pci setup code was
    expecting a struct uart_port and not a struct uart_8250_port, leading to
    the following concerning warnings:
    
    drivers/tty/serial/8250/8250_pci.c: In function ‘pci_brcm_trumanage_setup’:
    drivers/tty/serial/8250/8250_pci.c:1086:2: warning: passing argument 3 of ‘pci_default_setup’ from incompatible pointer type [enabled by default]
      int ret = pci_default_setup(priv, board, port, idx);
      ^
    drivers/tty/serial/8250/8250_pci.c:1036:1: note: expected ‘struct uart_port *’ but argument is of type ‘struct uart_8250_port *’
     pci_default_setup(struct serial_private *priv,
     ^
    drivers/tty/serial/8250/8250_pci.c: At top level:
    drivers/tty/serial/8250/8250_pci.c:1746:3: warning: initialization from incompatible pointer type [enabled by default]
       .setup  = pci_brcm_trumanage_setup,
       ^
    drivers/tty/serial/8250/8250_pci.c:1746:3: warning: (near initialization for ‘pci_serial_quirks[56].setup’) [enabled by default]
    
    I'd also expect the initialization to not function correctly, and
    perhaps dereference random garbage due to this.  Since the uart_port
    is a field within the uart_8250_port, the adaptation to fix these
    warnings is a straightforward removal of a layer of indirection.
    
    Cc: Stephen Hurd <shurd@broadcom.com>
    Cc: Michael Chan <mchan@broadcom.com>
    Cc: Ben Hutchings <ben@decadent.org.uk>
    Cc: Rui Xiang <rui.xiang@huawei.com>
    Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
    Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
    82a938ab
8250_pci.c 108 KB