From: Damien Le Moal <dlemoal@kernel.org>
To: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
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: Thu, 21 May 2026 13:22:31 +0200 [thread overview]
Message-ID: <6499a394-25f8-479e-aea1-a69b86657982@kernel.org> (raw)
In-Reply-To: <ag16iA6JLwGGLR8_@monoceros>
On 2026/05/20 11:12, Uwe Kleine-König (The Capable Hub) wrote:
> 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,
> }, {
> ...
Yes, I think this is nice.
>
> then. Or would you prefer something more compact like:
>
> { PCI_DEVICE(0x8086, 0x7010),
> .driver_data = piix_pata_mwdma },
>
> ?
>
> Best regards
> Uwe
--
Damien Le Moal
Western Digital Research
prev parent reply other threads:[~2026-05-21 11:22 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)
2026-05-21 11:22 ` Damien Le Moal [this message]
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=6499a394-25f8-479e-aea1-a69b86657982@kernel.org \
--to=dlemoal@kernel.org \
--cc=cassel@kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikpelinux@gmail.com \
--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