public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Markus Schneider-Pargmann <msp@baylibre.com>,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH] serial: 8250_pci: Consistently define pci_device_ids using named initializers
Date: Mon, 20 Apr 2026 21:32:57 +0300	[thread overview]
Message-ID: <aeZxWbZJSGHy_C_5@ashevche-desk.local> (raw)
In-Reply-To: <20260420175648.1709935-2-u.kleine-koenig@baylibre.com>

On Mon, Apr 20, 2026 at 07:56:48PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> ... and PCI device helpers.
> 
> The various struct pci_device_id were defined using a mixture of
> initialization by position and by name. Some use the PCI device helpers
> (like PCI_DEVICE and PCI_DEVICE_SUB) and others don't.
> 
> Consistently use named initializers, drop assignments of 0 by position
> for .class and .class_mask and use the PCI device helpers. Also use
> consistent line-breaks and positioning for opening and closing curly
> braces.
> 
> The secret plan is to make struct pci_device_id::driver_data an
> anonymous union (similar to
> https://lore.kernel.org/all/cover.1776579304.git.u.kleine-koenig@baylibre.com/)
> and that requires named initializers. But it's also a nice cleanup on
> its own.

Can we rather switch to PCI_DEVICE_DATA() and perhaps you would like to have
PCI_DEVICE_SUB_DATA() implemented in the similar way.

This will shorten a lot the lines, the

		PCI_DEVICE_SUB(PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
			       PCI_SUBVENDOR_ID_CONNECT_TECH, PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232),
		.driver_data = pbn_b1_8_1382400,

to, for example,

		PCI_DEVICE_SUB_DATA(V3, V960, CONNECT_TECH, BH8_232, pbn_b1_8_1382400),

(Yes, in some cases, I guess blacklist mostly, it might require to have a
 common definition in pci_ids.h for both or more drivers. Or something like
 8250_pci_ids.h in the drivers/tty/serial/8250/ if the global one seems too
 much.)

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-04-20 18:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20 17:56 [PATCH] serial: 8250_pci: Consistently define pci_device_ids using named initializers Uwe Kleine-König (The Capable Hub)
2026-04-20 18:32 ` Andy Shevchenko [this message]
2026-04-21  8:53   ` Uwe Kleine-König (The Capable Hub)

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=aeZxWbZJSGHy_C_5@ashevche-desk.local \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=msp@baylibre.com \
    --cc=u.kleine-koenig@baylibre.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