From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.49 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795904702; b=R3MX1Zqhfu/YmRIF7ABl9zhgCBo6rOoWLrb9VQnAWGtsUFcUt7R/f1rfnai75+pZ02Jp YxZDmuFnMbZyGbaEzZAug+2XWeiJjHBN+Qh1k0vIJU/FML0HzdSNaoW3iWcgGI57MGEan MGuJMvjpqlQT4tegeZIghiIasiFjLbKgnyKKqbZO3fJcc/UBVZ/QQdhxzNhRA2I9D56HR hWrUx3g18qQmP5dpOtIWP+B6nXPXPV7DGJ6eKs4SNzjEWSZz+ga8bUN2FkuC/J/4PqO5H jKIVagKg56YTOIegD8kUdOVs5QxwwKpW1ykItIRJEVw+6IrDVN+GmtLDSdURor+Yw9g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795904702; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=Lmz8A8Ly0653hpfgff1noF6lfipSKLOmUqtRuIEFZU4=; b=v7iKevgegIy4gXHSV58zDqO+eyLLw9zEQ3WL+vbFlPlA50Sc9CetIe7+j2sTFBjOg9Mc QOM67iVXFgefr1vLYwwnOt8uk5rq2INHBBKt3xzTFFio0IJh30vRfg83J1CM5pZK4RGmL Sczc4U8aWuMaU/BRGTaDXncWnJeVhwDU7ZyAs+i+dyZWDq9quOrxq7tjBQBvn4ksWzZrX IrThYuW2lP0q0HNO1QFecygUZApAPPNXva+WpGRacs6nO6maA/xJYLqNzQHGDhBtRJmYn GgP5ITUWJ+EDw2bvCcdtC5/XHP4VkeslPCJnP9Xa7r40tys88Pw4w/U8eCBdx46wm5w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass header.d=baylibre.com header.i=@baylibre.com header.a=rsa-sha256 header.s=google header.b=jlAovNoF; arc=none smtp.remote-ip=209.85.128.49 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7790C606A31C for ; Sat, 28 Nov 2026 22:25:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7790C606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.a=rsa-sha256 header.s=google header.b=jlAovNoF Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4bba5e17cbeso36727205e9.1 for ; Sat, 28 Nov 2026 14:25:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1795904700; x=1796509500; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=Lmz8A8Ly0653hpfgff1noF6lfipSKLOmUqtRuIEFZU4=; b=jlAovNoFQqjIiuOVzwmDeLW+d5ZRy0GhW+JxuZjJX2QZpUvyGozuFyUenX04tqMRu8 qsO/3w1S3Y0zpKiUseiit000BdiwHzv6QL22UadDtk01hw3pZHFV1t93TvPqBucQZFas f9V8zOjaXztyXzaK6CF8Lmg+7Fn/uLyA2YlGym7bbbZ4rR6MrwHvel8FCj1O723fNfJL sM9LPTXQ/4PJcHHdgwZe4ykbVLzIKAYM3jriIPr42tflUVdhMUfJrR9Byppxg8xaMxkP Ol8cHKMnUqdyVG1IZg6IrrGsUEzAuSi5Od8zhI6jb/tsgf2xO+pr2TF3ZLou6qOlVDuk b4Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795904700; x=1796509500; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Lmz8A8Ly0653hpfgff1noF6lfipSKLOmUqtRuIEFZU4=; b=DWT8chgwEoTa8ARHWl/Z1NrMxPRnK1skmRMfkscUQEq1GNV5Ai5MyOlylgSGjMWAlX 2c73nCJ+7Uhrea5IlYT+XblxPIfjx9InrklMf6ailseibDywwkJ0nioTiKXauT3N9ykz gllDwJ9EiPNsOkuq4R01EtgzBHUzrE0CFBZ5KFOJwZZ5LYOlrl5CexRwOO2pc0qGI7FR mCEmaRs4kpI92/e/i0IKJLK2HeItUEBQl5Y6orbwyN8wSX7NzpRFb5T5hTiMPZF/WRbh 36pA4ap7jgOoz/R6wv26zvXTbmfBX0yYAaeySEgdTPx8jDkR9x/WRF9M3QfugjfIpBcv oIkw== X-Forwarded-Encrypted: i=1; AL+hErHhrigVLZxKDFZJgR/tVZoQm/KRencX6rZ0w/mZlViqfsZHeJIPi3aYXi16wgyD3XOUnQmJZi2U4Gs6v3U=@vger.kernel.org X-Gm-Message-State: APuU4Z9lMv/lUHEffSq1T0ila9njXbTvm+HPg8TT3Ake6Cs3O/Htnq4l qWEJEZvKt0kIG7wG3LCXns9ygL6zE7bu7892EDKOHWa8TdZd5iJnZdwEk8lCH3VgNhtPJ0EKO2s 93lOjzg8= X-Gm-Gg: AZFdTZft2Dxx6gOcu/UMNbOQiqYKHgWtYG/9rQBZST8ZBlpYC0UgLHH2MUEwMyXrrAf uWYemTJdfCirtV7ZowXnUmfN17i6sbExJ9t+Yo+KmksHz1+tfTuo2Q1tTt9Tm6fN3Cqiw1Yd+Z7 dX8J5XwHeCRm9f2khNFmd2wgtivu6mIuj/FpbYFQmVBd8PUuYgXjmNhpmy+F1x7UsMgrsLIaxby rNxtc8+sAN+8oV1W/C0HxhrVm/tKPG3By7ROrnB7tsqu8e29hTQh3JpggL3SvJPYnF6SwdGp8rL cFyjexK4s85o+vQJCxboeNNa/8pV38PnTVATthru8Zfuk1MEQswZxYpqvFMFblKYPhFIUQhdUwE OqreHrwhEHnxLGr8a7pJAbpbcXZqI3kFpQYHPhmnqEsnQ2+s2P+6/G2JPEaDgJfNxJ3mzC4SwWu RvGxLwQ/+sfv/4B79q4cLTebjBHzDbXS2ehicZzsc26z6r3JG7/H38LfsUvGmJ/hyklr8+UOeCa ZQb0URA/pyaVM+B4I7jIsyH6rstTrdkXmo9wbdaXDtSAbmiprWqTB/4+Z2YU60OVmZd0zNL2UyN K9mlthoSTX5lXki/t3ADXoAZv0fGb8UDeQ== X-Received: by 2002:a05:600c:6744:b0:4bb:afae:150d with SMTP id 5b1f17b1804b1-4bbafae24acmr175042105e9.33.1795904699525; Sat, 28 Nov 2026 14:24:59 -0800 (PST) Received: from localhost ([2a02:8071:6e30:8500:1d24:d58d:2b65:c291]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-4bb906635c7sm527689265e9.2.2026.11.28.14.24.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Nov 2026 14:24:57 -0800 (PST) Date: Sat, 28 Nov 2026 23:24:55 +0100 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Guenter Roeck Cc: Pawel Zalewski , Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, Danilo Krummrich , Bjorn Helgaas , Takashi Sakamoto , Geert Uytterhoeven , Aleksa Savic , linux-kernel@vger.kernel.org, Ping Cheng , Jason Gerecke , linux-hwmon@vger.kernel.org, "Christian A. Ehrhardt" Subject: Re: [PATCH v1 0/9] HID: Make driver_data in hid_device_id a union Message-ID: References: <87ba5a17-5007-4d41-8cea-76328e789537@roeck-us.net> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="z7uvitqvwbnm5fku" Content-Disposition: inline In-Reply-To: <87ba5a17-5007-4d41-8cea-76328e789537@roeck-us.net> --z7uvitqvwbnm5fku Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH v1 0/9] HID: Make driver_data in hid_device_id a union MIME-Version: 1.0 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_de= vice_id-v1-0-a08e3989c283@thegoodpenguin.co.uk/ > > [2] https://lore.kernel.org/linux-input/20260727-mod-devicetable-hid_de= vice_id-v3-0-980896ca283e@thegoodpenguin.co.uk/ > >=20 > > Reviewed-by: Pawel Zalewski >=20 > 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". >=20 > 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 --z7uvitqvwbnm5fku Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmsLVLUACgkQj4D7WH0S /k7Yhwf/bRF6SfVUPUdv5IDyg5Bvb6/Ge69OBPO7mgBwuzosxAj6t1bpH+KZcG7j /DPiMUJorGar3/Xg4w7tVAw4Zhr/2sFQilx/eO5bUHYJRNsbGfC7BJTWDUyhg9a6 eifRsOSYNv7HszCKdsMJ9bBpO7X4sqGzIlZqQeE+3Yuv4Zp5aHG67bR5BTMcjtzs 6AkUElI/KGejn1wFID+E7C7pfozFR6NL7MxmLac8nfyTaIBNzUUwDRKz6tYrYgRj vZnoeM7pvnMo0+jBjc4ww1tqYOgv55CMY4Zs4w9AbS4AX7NLZ/Pm42QfqfQcjIfV bJovqtgQiqCC3cFmx5Y+6nIuSsvJ4w== =Opjx -----END PGP SIGNATURE----- --z7uvitqvwbnm5fku--