From: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Pawel Zalewski <pzalewski@thegoodpenguin.co.uk>,
Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <bentiss@kernel.org>,
linux-input@vger.kernel.org, Danilo Krummrich <dakr@kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
Takashi Sakamoto <o-takashi@sakamocchi.jp>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Aleksa Savic <savicaleksa83@gmail.com>,
linux-kernel@vger.kernel.org, Ping Cheng <ping.cheng@wacom.com>,
Jason Gerecke <jason.gerecke@wacom.com>,
linux-hwmon@vger.kernel.org,
"Christian A. Ehrhardt" <lk@c--e.de>
Subject: Re: [PATCH v1 0/9] HID: Make driver_data in hid_device_id a union
Date: Sat, 28 Nov 2026 23:24:55 +0100 [thread overview]
Message-ID: <awtTtfZyz_QjM1bN@monoceros> (raw)
In-Reply-To: <87ba5a17-5007-4d41-8cea-76328e789537@roeck-us.net>
[-- Attachment #1: Type: text/plain, Size: 2056 bytes --]
Hello Guenter,
On Sat, Nov 28, 2026 at 10:50:45AM -0800, Guenter Roeck wrote:
> On 11/25/26 06:23, Pawel Zalewski wrote:
> > For the record I did attempt this in the past [1], this approach was
> > rejected and a series which changes driver_data to be always an
> > integer was created instead [2]. However, I personally much prefer the
> > anonymous union approach, given that it will already be the case in
> > other subsystems. The HID subsystem doesn't need to go its own way and
> > the alternative is slightly uglier in practice (as you end up looking
> > up from tables via an index).
I think pointers for HID devices are a tad uglier compared to other
devices because you can set driver_data using the new_id mechanism. But
I think that's the fault of new_id and I'd consider throwing that out.
(Though Pawel's patch idea to only accept driver data values that
already exist decreases the danger by a big margin. And then pointers
are not worse than enums/integers.)
> > [1] https://lore.kernel.org/linux-input/20260518-mod-devicetable-hid_device_id-v1-0-a08e3989c283@thegoodpenguin.co.uk/
> > [2] https://lore.kernel.org/linux-input/20260727-mod-devicetable-hid_device_id-v3-0-980896ca283e@thegoodpenguin.co.uk/
> >
> > Reviewed-by: Pawel Zalewski <pzalewski@thegoodpenguin.co.uk>
>
> I don't know what happened with that series, but it does miss
> at least the hwmon driver which also uses driver_data as pointer
> (patch 5/9 of this series). Personally I don't really care which
> approach is used, though I do content the notion that using
> driver_data as pointer would be an "offender" (unless one declares
> that the Linux kernel would have more than 500 such "offenders".
>
> On as side note, unless I am missing something, it seems to me that
> both series above might miss drivers/hid/hid-steelseries-arctis.c,
> though possibly I misunderstand the code.
I didn't check Pawel's series, but mine has
drivers/hid/hid-steelseries-arctis.c | 39 ++-
in the diffstat.
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2026-11-28 22:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 7:21 Uwe Kleine-König
2026-11-25 7:21 ` [PATCH v1 5/9] HID: core: " Uwe Kleine-König
2026-11-25 14:23 ` [PATCH v1 0/9] HID: " Pawel Zalewski
2026-11-28 18:50 ` Guenter Roeck
2026-11-28 22:24 ` Uwe Kleine-König [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=awtTtfZyz_QjM1bN@monoceros \
--to=u.kleine-koenig@baylibre.com \
--cc=bentiss@kernel.org \
--cc=bhelgaas@google.com \
--cc=dakr@kernel.org \
--cc=geert@linux-m68k.org \
--cc=jason.gerecke@wacom.com \
--cc=jikos@kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=lk@c--e.de \
--cc=o-takashi@sakamocchi.jp \
--cc=ping.cheng@wacom.com \
--cc=pzalewski@thegoodpenguin.co.uk \
--cc=savicaleksa83@gmail.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
all inboxes | Powered by JetHome®