From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:35787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvkEr-0001A8-0v for qemu-devel@nongnu.org; Fri, 10 Feb 2012 01:45:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvkEd-0007XP-J0 for qemu-devel@nongnu.org; Fri, 10 Feb 2012 01:45:44 -0500 Received: from ozlabs.org ([203.10.76.45]:37281) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvkEc-0007XB-Qp for qemu-devel@nongnu.org; Fri, 10 Feb 2012 01:45:31 -0500 Date: Fri, 10 Feb 2012 17:45:13 +1100 From: David Gibson Message-ID: <20120210064513.GI10536@truffala.fritz.box> References: <1328761361-23119-1-git-send-email-david@gibson.dropbear.id.au> <20120209095823.GE22832@truffala.fritz.box> <4F339AC1.6080700@web.de> <201202091207.51350.paul@codesourcery.com> <4F33D401.9070608@web.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nVMJ2NtxeReIH9PS" Content-Disposition: inline In-Reply-To: <4F33D401.9070608@web.de> Subject: Re: [Qemu-devel] [PATCH] ioctl() numbers are unsigned (the man page lies) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: avi@redhat.com, mtosatti@redhat.com, Paul Brook , qemu-devel@nongnu.org --nVMJ2NtxeReIH9PS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 09, 2012 at 03:11:13PM +0100, Jan Kiszka wrote: > On 2012-02-09 13:07, Paul Brook wrote: > >>>> What about naming the problem instead: > >>>> > >>>> /* Comparison with IOCTL macros on 32-bit hosts requires unsigned. */ > >>> > >>> Just once, it would be nice to post something to this list and get a > >>> substantive comment _before_ the bitching about minutiae. > >>> > >>> Oh, and it's not just 32-bit hosts, it's anywhere sizeof(int)=3D=3D4, > >>> which includes ppc64 amongst other 64-bit hosts. > >> > >> Then state "if int is 32 bits". The comment is unfortunately not helpf= ul > >> without the commit log. > >=20 > > Int is 32 bits on every host we're ever likey to care about, so clearly= =20 > > there's something else going on. >=20 > Yep. So a better explanation could be "Required for comparison with > unsigned IOCTL macro values". This wasn't noticed so far as the original > code was never build on anything but IA32/64. Right. The problem still exists on x86 and x86_64, but it occurs for a different set of ioctls (IOC_READ instead of IOC_WRITE). I guess we never did this sort of signed comparison on an IOC_WRITE ioctl number (comparing ioctl numbers for equality isn't a particularly obvious thing to do from userspace, after all). --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --nVMJ2NtxeReIH9PS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk80vPgACgkQaILKxv3ab8Z6VwCfbEIdM2sl7O8Cq4g73xEW+HGB 8EcAnji2Bm8vnKr3frxFLvT13ow4pL2R =Keop -----END PGP SIGNATURE----- --nVMJ2NtxeReIH9PS--