[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.0.98.0704260850200.9964@woody.linux-foundation.org>
Date: Thu, 26 Apr 2007 08:53:48 -0700 (PDT)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Pavel Machek <pavel@....cz>
cc: Johannes Berg <johannes@...solutions.net>,
Nick Piggin <npiggin@...e.de>, Mike Galbraith <efault@....de>,
linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Con Kolivas <kernel@...ivas.org>,
suspend2-devel@...ts.suspend2.net, Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
Arjan van de Ven <arjan@...radead.org>,
"Rafael J. Wysocki" <rjw@...k.pl>
Subject: Re: suspend2 merge (was Re: [Suspend2-devel] Re: CFS and suspend2:
hang in atomic copy)
On Thu, 26 Apr 2007, Pavel Machek wrote:
>
> #define SNAPSHOT_ATOMIC_SNAPSHOT _IOW(SNAPSHOT_IOC_MAGIC, 3, void *)
> #define SNAPSHOT_SET_IMAGE_SIZE _IOW(SNAPSHOT_IOC_MAGIC, 6, unsigned long)
> #define SNAPSHOT_AVAIL_SWAP _IOR(SNAPSHOT_IOC_MAGIC, 7, void *)
> #define SNAPSHOT_GET_SWAP_PAGE _IOR(SNAPSHOT_IOC_MAGIC, 8, void *)
> #define SNAPSHOT_SET_SWAP_FILE _IOW(SNAPSHOT_IOC_MAGIC, 10, unsigned int)
> #define SNAPSHOT_PMOPS _IOW(SNAPSHOT_IOC_MAGIC, 12, unsigned int)
>
> Are these a problem? Do we need to just use u32 as a argument to keep
> ioctl numbers same between 32 and 64bit versions?
No, you need to use the *proper* type as an argument, and assuming that
type has the same representation in both 32-bit and 64-bit world, the
numbers will automatically match.
Using "void *" is totally bogus. It's supposed to be the actual argument
you pass in, not the pointer to it. If your argument doesn't have a
"struct xyz" kind of format, then you could use "int" (or u32 or
something: but realistically int is 32-bit for the forseeable future), but
it's always wrong to pass in "void *" or "unsigned long", since either of
those are just a sign of the interface being either (a) misunderstood or
(b) broken.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists