qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: avi@redhat.com, mtosatti@redhat.com,
	Paul Brook <paul@codesourcery.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] ioctl() numbers are unsigned (the man page lies)
Date: Fri, 10 Feb 2012 17:45:13 +1100	[thread overview]
Message-ID: <20120210064513.GI10536@truffala.fritz.box> (raw)
In-Reply-To: <4F33D401.9070608@web.de>

[-- Attachment #1: Type: text/plain, Size: 1478 bytes --]

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)==4,
> >>> which includes ppc64 amongst other 64-bit hosts.
> >>
> >> Then state "if int is 32 bits". The comment is unfortunately not helpful
> >> without the commit log.
> > 
> > Int is 32 bits on every host we're ever likey to care about, so clearly 
> > there's something else going on.
> 
> 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).

-- 
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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2012-02-10  6:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-09  4:22 [Qemu-devel] [PATCH] ioctl() numbers are unsigned (the man page lies) David Gibson
2012-02-09  8:30 ` Jan Kiszka
2012-02-09  9:58   ` David Gibson
2012-02-09 10:06     ` Jan Kiszka
2012-02-09 12:07       ` Paul Brook
2012-02-09 14:11         ` Jan Kiszka
2012-02-10  6:45           ` David Gibson [this message]
2012-02-10  6:43       ` David Gibson
2012-02-10  7:27         ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120210064513.GI10536@truffala.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=avi@redhat.com \
    --cc=jan.kiszka@web.de \
    --cc=mtosatti@redhat.com \
    --cc=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).