lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZmQrA2_TjgK33uhn@surfacebook.localdomain>
Date: Sat, 8 Jun 2024 12:57:23 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Crescent Hsieh <crescentcy.hsieh@...a.com>
Cc: Jiri Slaby <jirislaby@...nel.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org
Subject: Re: [PATCH 4/6] tty: serial: 8250: Add check for setting default
 serial interface

Fri, Jun 07, 2024 at 07:43:34PM +0800, Crescent Hsieh kirjoitti:
> Moxa PCIe and Mini-PCIe boards are capable of switching the serial
> interface through software control, while other PCI boards switch the
> serial interface through hardware DIP switches.
> 
> This patch adds a check while setting the default serial interface.

...

> +static bool pci_moxa_is_pcie(unsigned short device)

Please, avoid potential collisions in the namespace, i.e.
start your function names with moxa, and not with pci.

This can be amended once you split out 8250_moxa.

> +{
> +	if (device == PCI_DEVICE_ID_MOXA_CP102E     ||
> +	    device == PCI_DEVICE_ID_MOXA_CP102EL    ||
> +	    device == PCI_DEVICE_ID_MOXA_CP104EL_A  ||
> +	    device == PCI_DEVICE_ID_MOXA_CP114EL    ||
> +	    device == PCI_DEVICE_ID_MOXA_CP116E_A_A ||
> +	    device == PCI_DEVICE_ID_MOXA_CP116E_A_B ||
> +	    device == PCI_DEVICE_ID_MOXA_CP118EL_A  ||
> +	    device == PCI_DEVICE_ID_MOXA_CP118E_A_I ||
> +	    device == PCI_DEVICE_ID_MOXA_CP132EL    ||
> +	    device == PCI_DEVICE_ID_MOXA_CP134EL_A  ||
> +	    device == PCI_DEVICE_ID_MOXA_CP138E_A   ||
> +	    device == PCI_DEVICE_ID_MOXA_CP168EL_A)
> +		return true;
> +
> +	return false;

Hmm... First of all, can this be done by using pci_is_pcie()?
Second, if the above is not sufficient, this can be read from driver data, no?

> +}

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ