Re: [PATCH] serial: 8250_pnp: Drop unused assignments from pnp_device_id arrays
From: Uwe Kleine-König (The Capable Hub)
Date: Tue Jun 09 2026 - 02:50:00 EST
Hello Jiri,
On Tue, Jun 09, 2026 at 06:33:28AM +0200, Jiri Slaby wrote:
> On 08. 06. 26, 19:00, Uwe Kleine-König (The Capable Hub) wrote:
> > Explicitly assigning .driver_data in drivers that don't use this member
> > is silly and a bit irritating. Drop these.
>
> You do not do that in the patch though.
Oh, I used the wrong commit message template. I wouldn't drop the
explicit zeros here because .driver_data is used as a bitmap and some
entries actually use a non-zero value here. So IMHO having the explicit
assignments is fine.
I'll send a v2 with the following commit log end of the week or so to
allow further feedback:
serial: 8250_pnp: Use named initializers for pnp_device_id array
While being less compact, using named initializers allows to more easily
see which members of the structs are assigned which value without having
to lookup the declaration of the struct. And it's also more robust
against changes to the struct definition.
The mentioned robustness is relevant for a planned change to struct
pnp_device_id that replaces .driver_data by an anonymous union.
This patch doesn't modify the compiled array, only their representation
in source form benefits. The former was confirmed with x86 and arm64
builds.
Also simplify the list terminator and use a consistent and more common
indention.
Thanks for paying attention, best regards
Uwe
Attachment:
signature.asc
Description: PGP signature