From: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
To: Jiri Slaby <jirislaby@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH] serial: 8250_pnp: Drop unused assignments from pnp_device_id arrays
Date: Tue, 9 Jun 2026 08:46:09 +0200 [thread overview]
Message-ID: <aiezs4ocgTd7dWDz@monoceros> (raw)
In-Reply-To: <fd9576ec-0dbc-4ecf-bc5d-2630c7df637e@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 1451 bytes --]
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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2026-06-09 6:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 17:00 [PATCH] serial: 8250_pnp: Drop unused assignments from pnp_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-06-09 4:33 ` Jiri Slaby
2026-06-09 6:46 ` Uwe Kleine-König (The Capable Hub) [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=aiezs4ocgTd7dWDz@monoceros \
--to=u.kleine-koenig@baylibre.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/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