Re: Add support for SUNIX multi I/O board

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 26, 2021 at 05:38:28PM +0800, Moriis Ku wrote:
> From: Morris Ku <saumah@xxxxxxxxx>
> 
> Sunix SDC Multi I/O board are different to Timedia's.
> 
> This patch adds proper support for Sunix SDC Multi I/O board.
> 
> Signed-off-by: Morris Ku<saumah@xxxxxxxxx>

Can you make your subject line look like:
	[PATCH] serial: 8250_pci: add support for...

to match up the other patches for this driver?

> ---
>  tty/serial/8250/8250_pci.c | 36 +++++++++++++++++++++++++++++++++++-
>  1 file changed, 35 insertions(+), 1 deletion(-)
> 
> diff --git a/tty/serial/8250/8250_pci.c b/tty/serial/8250/8250_pci.c
> index 8814ff38..5758a98b 100644
> --- a/tty/serial/8250/8250_pci.c
> +++ b/tty/serial/8250/8250_pci.c
> @@ -1802,6 +1802,25 @@ pci_sunix_setup(struct serial_private *priv,
>  	return setup_port(priv, port, bar, offset, 0);
>  }
>  
> +static int
> +pci_sunix_sdc_setup(struct serial_private *priv,

Move this to be all on one line please.

> +		const struct pciserial_board *board,
> +		struct uart_8250_port *port, int idx)

Line up with the "(" or checkpatch will complain.

> +{
> +	int bar;
> +	int offset;
> +
> +	port->port.flags |= UPF_FIXED_TYPE;
> +	port->port.type = PORT_SUNIX;
> +
> +	if (idx < 4) {
> +		bar = 1
> +		offset = idx * board->uart_offset;
> +	}

So if idx is > 4, bar is unknown?  That feels like a huge bug :(

> +
> +	return setup_port(priv, port, bar, offset, 0);

Same for offset, looks like it could be used uninitialized as well.

The compiler didn't complain about this?

thanks,

greg k-h



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux