Re: [PATCH v1] PNP: Drop unused assignment of pnp_device_id driver data

From: Rafael J. Wysocki (Intel)

Date: Tue Jun 30 2026 - 08:38:47 EST


On Wed, Jun 10, 2026 at 4:43 PM Uwe Kleine-König (The Capable Hub)
<u.kleine-koenig@xxxxxxxxxxxx> wrote:
>
> The driver explicitly sets the .driver_data member of struct
> pnp_device_id to zero without relying on that value. Drop these unused
> assignments.
>
> While touching this array simplify the list terminator and align the the
> array's coding style to what is used most for these.
>
> This patch doesn't modify the compiled array, only its representation in
> source form benefits. The former was confirmed with builds on x86 and
> arm64.
>
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@xxxxxxxxxxxx>
> ---
> Hello,
>
> I intend to change struct pnp_device_id and for that it's required that
> .driver_data is not assigned using a list initializer. Instead of
> converting it to a named initializer, drop the assignment as the value
> is unused. So this is both a cleanup and a preparation for a later patch
> series.
>
> See
> https://lore.kernel.org/all/cover.1779878004.git.u.kleine-koenig@xxxxxxxxxxxx/
> for a more verbose description on the mentioned change to struct
> pnp_device_id (though this is about platform_device_id, but the idea
> here is the same).
>
> Best regards
> Uwe
>
> drivers/pnp/system.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pnp/system.c b/drivers/pnp/system.c
> index 835113b2cb04..bd939b564379 100644
> --- a/drivers/pnp/system.c
> +++ b/drivers/pnp/system.c
> @@ -17,10 +17,10 @@
>
> static const struct pnp_device_id pnp_dev_table[] = {
> /* General ID for reserving resources */
> - {"PNP0c02", 0},
> + { .id = "PNP0c02" },
> /* memory controller */
> - {"PNP0c01", 0},
> - {"", 0}
> + { .id = "PNP0c01" },
> + { }
> };
>
> static void reserve_range(struct pnp_dev *dev, struct resource *r, int port)
>

Applied as 7.3 material, thanks!