From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.50 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795904702; b=QacirZAXgZwWpSWOKF1Ai1fsZKj9b0Ucev7FnzKvojBKXOdxJe0hxmITG3GLwIC0h6hX qCdfZhksvzl+3W7TXNl8Bo4Ql3vZ3FPVocRhHwX5FXQ0OgPbeJtSdyMoOlh6H2yvCf5Sn nX9bX+KILZDdMDPsutZt31qwlZtgDTE5sM/7AprgToeI7casN7pYfdIINw+yBZh7EHmJC hiWOt1urV92G0QYNQGVmHUMq3Qx3YifT/KWlxPpMBNB3kE2NTNhy7LfUkg165D+ANAx1g Ya1LqIRNATwbogWuEQPtF7y3vgUBbLnBIHZaEMl3Ej7qchesay77oljGkgphoG5WyJw== 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=h77xeYWUOxRJxHm8XaQUPU+4Yuqrs7BuaEfGOclb1b6ux0mi7QjMM2ErGZTVlckNP8Dv 3mZVI0pKEk6oZ6pBps/d9eauTX5fZ30mfkAaqueG9l3Kr5X8KcEqxXZzGqex+S7ese8m3 ZB1nzxI51ZKs/pOucT3Gf5C8Qwe8LcpKl1+VxoRWYuTomFd4sTzNuRXccQlmlTPo1qRN4 +4ta3qzCSY+lRzKa5Up3yAswcoLAeOp2UfGJDlyff6mnt6iRjwNy0sy69uailoOFH5vsa Z44CbPcRY5zVeCZ5UeP1jvmH/e3gqVEhrFRssGFUoC6rGevq6EC7DHNjKa13uKxe4TA== 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.50 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 898E4606A323 for ; Sat, 28 Nov 2026 22:25:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 898E4606A323 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, unprotected) header.d=baylibre.com header.i=@baylibre.com header.a=rsa-sha256 header.s=google header.b=jlAovNoF Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4bb69f5b161so61331695e9.0 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=CALwwZLRhSrQ1A7XFaUzn7Y5F4rr71b8L/qk6rxsCf77Y5ay4Gr+hYcT2do3E4WXuC 1m9YyRCmD2fty6gLDVOtYldfVZY9VbQQg2IKY5ScETp9JbUah+MZHbjBh8sJQtNp2l2N AkZZe7vqMaqAPDchYjzwOiGkhU4opZwHHUspd2XOslQve/cAf6l0Owe52rEyQ2VLqzjT Cb5AgCjEXncuhp0PCwTYT60KgZ7Hwai8Rc0TJI56Y1/vxnKRPP5RZ9g1TJsLPACLY9dy WV5QJJgVXTtBWeiZVXhbzI/HdbFpRQmZwQM9rPEyRBU/Sh6i7VOWmQSbxR3+tJAGOEaT GFUA== X-Forwarded-Encrypted: i=1; AL+hErH2tiTx3Fc9PhhuFfQpk5WCI3FsOKw+7dQzx//paJtehSFVptVvY0d7qNA/LtMwDHA5cgGHVhyn6bbwTA==@vger.kernel.org X-Gm-Message-State: APuU4Z+qDE7cebsl8ITEbs4XgjcNE5BulrHOfwEKIUHPWGMWidFLDzXm dXLthBhsYUEEpbK52mQuVT5LWVL2FsBNH4SioES/zn/bnqLckwFt4UNdC6kKHTYU76U= X-Gm-Gg: AZFdTZfozLJzGrol643LyeEVLoKtcR5EroyQ/zWhwqBsUDAOKepKofmYStUsGSWGC9O BVJNMURt8H7ZHBiqpoZTnsPhazGgYcjNWLPJ47PZsGyJZ75Is3XnWwdzv7dRKEA8FUuTeAn6IHD K1guXtVWphMHn0YOWYZzODKkTc01LZ7Bm+hLYU1XNk/c2e2qtjQ2TBUwoqHqwiuZLswYmh3zE85 CNWadX+E7oJ4WHuPsZErktc5R5P3aSBf5FceeUBBZqn/VGwpQxCalxnWNwXbjizrLEHtA2AMM+/ SfvDvfuNckh+DB/b4RirwSAmb4seMtNTFONa99KCzR5dMH3pALDr0vfew9kMTk8Zi5Nb5Fy51sg 5+eUETfgB75AHubMD1jaGVwIdETMDsWLri/eSUQ2+xuwv6ZiJCHB6jkKrcVlIo7pb0HBsNXzin6 eOZLYbQeIbBfZe+RiwU0JHtvlFahQ6Hp4LuzK/q6ifhhx/YH0Oi2t/Tab0zqMMfVYpNJHnP4e4F wPXZRz3N21dwjUOc+rELmitcRJ0toD7Z4VnpclL3q2c0MkjLu20rjGOu+MsYTPWpeLEns3UYWKu qS2llhFsojLzAS4obWGjr6E1VM7CuQKetw== 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-input@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--