From: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: Niklas Cassel <cassel@kernel.org>,
Mikael Pettersson <mikpelinux@gmail.com>,
linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
Markus Schneider-Pargmann <msp@baylibre.com>
Subject: Re: [PATCH] ata: Consistently define pci_device_ids using named initializers
Date: Wed, 20 May 2026 11:12:30 +0200 [thread overview]
Message-ID: <ag16iA6JLwGGLR8_@monoceros> (raw)
In-Reply-To: <b06a2fec-441f-4be2-aae6-3796c1e45cfc@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 2091 bytes --]
On Mon, May 04, 2026 at 10:09:53AM +0200, Damien Le Moal wrote:
> On 4/30/26 19:06, Uwe Kleine-König (The Capable Hub) wrote:
> > ... and PCI device helpers.
> >
> > The .driver_data member in the various struct pci_device_id arrays were
> > initialized mostly by list expressions. This isn't easily readable if
> > you're not into PCI. Using named initializers is more explicit and thus
> > easier to parse.
> >
> > Also use PCI_DEVICE to conveniently assign .vendor, .device, .subvendor
> > and .subdevice where appropriate.
> >
> > 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.
> >
> > This change doesn't introduce changes to the compiled pci_device_id
> > arrays. Tested on x86 and arm64.
> >
> > Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
>
> This looks like a nice cleanup to me. A couple of nits below.
> With that, feel free to add:
>
> Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
>
> [...]
>
> > diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
> > index 495fa096dd65..fac1266f7fa6 100644
> > --- a/drivers/ata/ata_piix.c
> > +++ b/drivers/ata/ata_piix.c
> > @@ -154,184 +154,186 @@ static unsigned int in_module_init = 1;
> >
> > static const struct pci_device_id piix_pci_tbl[] = {
> > /* Intel PIIX3 for the 430HX etc */
> > - { 0x8086, 0x7010, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_mwdma },
> > + { PCI_DEVICE(0x8086, 0x7010), .driver_data = piix_pata_mwdma },
>
> Please split the line before the .driver_data like for all the other changes.
> That will make things consistent...
I would go for
{
PCI_DEVICE(0x8086, 0x7010),
.driver_data = piix_pata_mwdma,
}, {
...
then. Or would you prefer something more compact like:
{ PCI_DEVICE(0x8086, 0x7010),
.driver_data = piix_pata_mwdma },
?
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2026-05-20 9:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 17:06 [PATCH] ata: Consistently define pci_device_ids using named initializers Uwe Kleine-König (The Capable Hub)
2026-05-04 8:09 ` Damien Le Moal
2026-05-20 9:12 ` Uwe Kleine-König (The Capable Hub) [this message]
2026-05-21 11:22 ` Damien Le Moal
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=ag16iA6JLwGGLR8_@monoceros \
--to=u.kleine-koenig@baylibre.com \
--cc=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikpelinux@gmail.com \
--cc=msp@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