The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Rosen Penev <rosenp@gmail.com>
Cc: linux-serial@vger.kernel.org, Jiri Slaby <jirislaby@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	"open list:TTY LAYER AND SERIAL DRIVERS"
	<linux-kernel@vger.kernel.org>,
	"open list:CLANG/LLVM BUILD SUPPORT:Keyword:b(?i:clang|llvm)b"
	<llvm@lists.linux.dev>
Subject: Re: [PATCH] serial: 8250_pci: fix -Winitializer-overrides for Brainboxes UC-260/271/701/756 entries
Date: Tue, 7 Jul 2026 17:21:19 +0200	[thread overview]
Message-ID: <2026070710-bronzing-handwork-33fe@gregkh> (raw)
In-Reply-To: <20260528201250.135691-1-rosenp@gmail.com>

On Thu, May 28, 2026 at 01:12:50PM -0700, Rosen Penev wrote:
> PCI_VDEVICE() expands to set .class=0 and .class_mask=0, but the Brainboxes
>  UC-260/271/701/756 entries immediately override those fields. This causes
>  a build error with clang -Werror,-Winitializer-overrides.
> 
> Fix by expanding PCI_VDEVICE() manually, omitting the trailing
>  .class/.class_mask zeroes so each field is set exactly once.
> 
> Found with W=1
> 
> Assisted-by: Opencode:Big-pickle
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
>  drivers/tty/serial/8250/8250_pci.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
> index 3e5bc9e8d269..0513f4b3c093 100644
> --- a/drivers/tty/serial/8250/8250_pci.c
> +++ b/drivers/tty/serial/8250/8250_pci.c
> @@ -5394,12 +5394,14 @@ static const struct pci_device_id serial_pci_tbl[] = {
>  	 * Brainboxes UC-260/271/701/756
>  	 */
>  	{
> -		PCI_VDEVICE(INTASHIELD, 0x0D21),
> +		.vendor = PCI_VENDOR_ID_INTASHIELD, .device = 0x0D21,
> +		.subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID,
>  		.class = PCI_CLASS_COMMUNICATION_MULTISERIAL << 8,
>  		.class_mask = 0xffff00,
>  		.driver_data = pbn_b2_4_115200,
>  	}, {
> -		PCI_VDEVICE(INTASHIELD, 0x0E34),
> +		.vendor = PCI_VENDOR_ID_INTASHIELD, .device = 0x0E34,
> +		.subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID,
>  		.class = PCI_CLASS_COMMUNICATION_MULTISERIAL << 8,
>  		.class_mask = 0xffff00,
>  		.driver_data = pbn_b2_4_115200,
> -- 
> 2.54.0
> 

Does not apply to the current tree :(

  reply	other threads:[~2026-07-07 15:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28 20:12 [PATCH] serial: 8250_pci: fix -Winitializer-overrides for Brainboxes UC-260/271/701/756 entries Rosen Penev
2026-07-07 15:21 ` Greg Kroah-Hartman [this message]
2026-07-07 19:57   ` Rosen Penev
  -- strict thread matches above, loose matches on Subject: below --
2026-06-03 23:26 Rosen Penev
2026-07-10 12:32 ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2026070710-bronzing-handwork-33fe@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=justinstitt@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=nick.desaulniers+lkml@gmail.com \
    --cc=rosenp@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox