Re: [PATCH v1 0/2] firewire: Simplify storing pointers in device id struct
Uwe Kleine-König (The Capable Hub) <[email protected]> Wed, 22 Apr 2026 10:40:09 +0200
| Newsgroups | gmane.linux.sound,gmane.linux.kernel.firewire.devel |
|---|---|
| Message-ID | <aeiJRw-I622NhiHj@monoceros> |
--o6cal6n77lgebwiu Content-Type: text/plain; protected-headers=v1; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH v1 0/2] firewire: Simplify storing pointers in device id struct MIME-Version: 1.0 Hello again, On Wed, Apr 22, 2026 at 10:30:24AM +0200, Uwe Kleine-K=F6nig (The Capable H= ub) wrote: > On Wed, Apr 22, 2026 at 10:19:21AM +0300, Andy Shevchenko wrote: > > On Tue, Apr 21, 2026 at 04:07:42PM +0200, Uwe Kleine-K=F6nig (The Capab= le Hub) wrote: > > > On Tue, Apr 21, 2026 at 09:53:57PM +0900, Takashi Sakamoto wrote: > > > > On Mon, Apr 20, 2026 at 07:39:32PM +0200, Christian A. Ehrhardt wro= te: > > > > > On Mon, Apr 20, 2026 at 06:08:16PM +0900, Takashi Sakamoto wrote: > >=20 > > ... > >=20 > > > > Thanks for the references. It looks like there is not much to consi= der > > > > outside of mm subsystem. But I have some concerns if supporting > > > > ARM/RISC-V adoptation of CHERI extension in Linux FireWire subsyste= m. > > > >=20 > > > > Any structures in UAPI header of this subsystem are defined with > > > > an assumption that the size of pointer in the existing System V > > > > architectures is up to 64 bits at most. We can see many usage of > > > > '__u64' type member for pointers (e.g. 'rom' in fw_cdev_get_info > > > > structure). I imagine to need defining specific structures for this= kind > > > > of 'fat' pointer. (The same assumption lays on compat ioctl.) > > >=20 > > > The Standard C answer to that is: The assumption that you can fit a > > > pointer in an unsigned long or u64 is not generally justified. This is > > > "only" given for all current Linux archtectures. And if you want an > > > integer type to store a pointer, use uintptr_t. > >=20 > > No, please don't. Linus was clear about this. Use `unsigned long` in th= at case. >=20 > On CHERI we have sizeof(unsigned long) =3D 4 and sizeof(void *) =3D 8, so > what Linus wants doesn't work. Correction, we have sizeof(unsigned long) =3D 8 and sizeof(void *) =3D 16 or course. --o6cal6n77lgebwiu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEyBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmnoiWcACgkQj4D7WH0S /k6vZwf2MaO+hdizR/dfeu806x5LS+2B+xB3HB1ZZm4Cd3NhNoUCYCUb/a7BxBij wKU81Bdyn8mw8XvBq/njGVf1nzzQxcR9FvJBxv0Odw+feVvRGbzolWAcoqw2h5i0 05rcfPwxNlAEjUDkEeRRzzx2ln5PRU4Ziv1ugELVESvngAI/UmK3ki376hMNdugd Q5LldfxVSN/Djwqcn5hP5g2G8fhUnYwkSAAVz8f5PHv1XvRKKpGnc7cKLHC1VBD2 Lkr8j27JpE72z7Vd4QYoLFPBBI9+zRChDsYPZhh79CN4BIcFDFJmxvEgAdUXCpR1 0nkuAWXPvOvNw1mGmaMuKtiMBVUY =aFGC -----END PGP SIGNATURE----- --o6cal6n77lgebwiu--