Re: [PATCH v1] floppy: Drop unused pnp driver data

From: Denis Efremov (Oracle)

Date: Wed Jun 10 2026 - 07:08:57 EST




On 10/06/2026 11:27, Uwe Kleine-König (The Capable Hub) wrote:
> The pnp_device_id array is only used for module data to support
> auto-loading the floppy module. So the .driver_data member is unused and
> this assignment can be dropped.
>
> While touching that array, align the 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 x86 and arm64
> builds.
>
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@xxxxxxxxxxxx>

Reviewed-by: Denis Efremov (Oracle) <efremov@xxxxxxxxx>

> ---
> 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/block/floppy.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
> index 0509746f8aed..dca495be0683 100644
> --- a/drivers/block/floppy.c
> +++ b/drivers/block/floppy.c
> @@ -5012,8 +5012,8 @@ MODULE_LICENSE("GPL");
>
> /* This doesn't actually get used other than for module information */
> static const struct pnp_device_id floppy_pnpids[] = {
> - {"PNP0700", 0},
> - {}
> + { .id = "PNP0700" },
> + { }
> };
>
> MODULE_DEVICE_TABLE(pnp, floppy_pnpids);
>
> base-commit: 49e02880ec0a8c378e811bc9d85da188d7c6204c