Re: [PATCH v3] serial: 8250_pci: Consistently define pci_device_ids using named initializers

From: Andy Shevchenko

Date: Wed Jun 03 2026 - 10:07:25 EST


On Wed, Jun 03, 2026 at 01:21:40PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> On Wed, Jun 03, 2026 at 11:43:14AM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> > On Wed, Jun 03, 2026 at 09:24:34AM +0300, Andy Shevchenko wrote:
> > > On Wed, Jun 03, 2026 at 08:12:38AM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> > > > On Tue, Jun 02, 2026 at 10:20:56PM +0200, Andy Shevchenko wrote:
> > > > > This patch broke the build.
> > > > >
> > > > > drivers/tty/serial/8250/8250_pci.c:5398:12: error: initializer overrides prior initialization of this subobject [-Werror,-Winitializer-overrides]
> > > > > 5398 | .class = PCI_CLASS_COMMUNICATION_MULTISERIAL << 8,
> > > > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > > include/linux/pci_ids.h:74:45: note: expanded from macro 'PCI_CLASS_COMMUNICATION_MULTISERIAL'
> > > > > 74 | #define PCI_CLASS_COMMUNICATION_MULTISERIAL 0x0702
> > > > >
> > > > > and so on...
> > > >
> > > > Oh, it works fine for me with clang 19.1.7, gcc 11.3.0, gcc 12.4.0, gcc
> > > > 13.3.0, gcc 14.2.0 and gcc 15.2.0, but I agree it's a bit obscure
> > > > because .class and .class_mask are specified twice; once by PCI_VDEVICE
> > > > and once explicitly.
> > >
> > > > Which compiler are you using that breaks here? I guess I might have
> > > > broken more drivers this way, so it would be great to have a setup to
> > > > reproduce your issue.
> > >
> > > My make command:
> > >
> > > make LLVM=-19 W=1 C=1 CF=-D__CHECK_ENDIAN__ ...
> > >
> > > The line the above error is from is from your patch.
> >
> > OK, I can reproduce with that cmdline, thanks. Expect a patch in a
> > moment.
>
> The pity is that an x86 allmodconfig fails to build for different
> reasons with W=1, so I cannot easily use that to check for other drivers
> that got that same clash between PCI_VDEVICE + explicit .class assignment :-\
>
> I'll experiment a bit about how to identify those, maybe I'll have grep
> over all my patches ...

You don't need to build the whole kernel for that, build subsystem by subsystem
where gigantic patches from you were applied.

Example:
$ make LLVM=-19 W=1 C=1 CF=-D__CHECK_ENDIAN__ -j64 CONFIG_COMPILE_TEST=y allmodconfig -- drivers/tty/serial/8250/


--
With Best Regards,
Andy Shevchenko