Date: Sat, 29 Nov 2014 14:09:27 +0300 From: Eygene Ryabinkin <rea@freebsd.org> To: Konstantin Belousov <kostikbel@gmail.com> Cc: freebsd-current@FreeBSD.org Subject: Re: [CFR][PATCH] drm2: don't assume that dev->driver->max_ioctl > *dev->driver->compat_ioctls_nr Message-ID: <ZAZeYmXbgG9a2l8Uw1QbxHDSt9s@fjKjvihIpFF5b3MzObHVvHLKl0E> In-Reply-To: <20141128173226.GW17068@kib.kiev.ua> References: <xmwjC4AQ874ym1oFCGAsPn1EJkI@1d%2BaJAniZP50FCDdGj54nd51%2Bks> <20141128173226.GW17068@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
--RIYY1s2vRbPFwWeW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Fri, Nov 28, 2014 at 07:32:26PM +0200, Konstantin Belousov wrote: > On Fri, Nov 28, 2014 at 04:29:42PM +0300, Eygene Ryabinkin wrote: > > I noticed that the current ioctl processing code for drm2 implicitely > > assumes that the number of native ioctls is higher than that of 32-bit > > compat ones, so it immediately gives EINVAL when > > nr >=3D dev->driver->max_ioctl. Seems that in future such assumption > > may not be true in all cases. > > I very much doubt that it could become true. Compat32 ioctl cannot > exist without its wider counterpart. OK. > > This can be fixed with the following patch: > > http://codelabs.ru/fbsd/patches/drm2/drm_drv-untangle-32bit-compat.di= ff > >=20 > > Any thoughts on it? > > I think either current way or patch are fine, but why changing something > which is fine ? Because the patched code will work with less assumptions and the patch isn't big or complex and introduces no additional code paths, just rearranges things. It also has more unified logics: if 32-bit compat is present and ioctl fits into its range -- do that. If ioctl fits into the native driver ioctl range -- do that. Otherwise -- bail out with an error. And "if" conditions are more uniform w.r.t. check for value of "nr". --=20 Eygene Ryabinkin ,,,^..^,,, [ Life's unfair - but root password helps! | codelabs.ru ] [ 82FE 06BC D497 C0DE 49EC 4FF0 16AF 9EAE 8152 ECFB | freebsd.org ] --RIYY1s2vRbPFwWeW Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iL4EABEKAGYFAlR5qWdfFIAAAAAALgAoaXNzdWVyLWZwckBub3RhdGlvbnMub3Bl bnBncC5maWZ0aGhvcnNlbWFuLm5ldDgyRkUwNkJDRDQ5N0MwREU0OUVDNEZGMDE2 QUY5RUFFODE1MkVDRkIACgkQFq+eroFS7Pv61wD/QuMYfukWTEv1tj5fIKkfCmKJ WTDp8BHYWBtYLMGqdvMA/3b4UknfcWCV7Pot5eR8xrg+4Upu2R1XGz65UwTVvn19 =w8yg -----END PGP SIGNATURE----- --RIYY1s2vRbPFwWeW--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZAZeYmXbgG9a2l8Uw1QbxHDSt9s>