[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1242108700.11251.304.camel@twins>
Date: Tue, 12 May 2009 08:11:40 +0200
From: Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: Arnd Bergmann <arnd@...db.de>
Cc: Ingo Molnar <mingo@...e.hu>, Paul Mackerras <paulus@...ba.org>,
Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 3/5] perf_counter: rework ioctl()s
On Tue, 2009-05-12 at 01:58 +0200, Arnd Bergmann wrote:
> On Friday 08 May 2009, Peter Zijlstra wrote:
> > -#define PERF_COUNTER_IOC_ENABLE _IO ('$', 0)
> > -#define PERF_COUNTER_IOC_DISABLE _IO ('$', 1)
> > +#define PERF_COUNTER_IOC_ENABLE _IOW('$', 0, u32)
> > +#define PERF_COUNTER_IOC_DISABLE _IOW('$', 1, u32)
> > #define PERF_COUNTER_IOC_REFRESH _IOW('$', 2, u32)
> > -#define PERF_COUNTER_IOC_RESET _IO ('$', 3)
> > +#define PERF_COUNTER_IOC_RESET _IOW('$', 3, u32)
>
> These ioctl definitions look malformed:
> _IOW('$', 0, u32) means that the ioctl will read a u32 in user
> space pointed to by (u32 __user *)arg, while what perf_ioctl
> actually does is cast arg to a u32. Moreover, exported headers
> should use __u32 instead of u32.
>
> PERF_COUNTER_IOC_REFRESH apparently was broken already, this
> patch also breaks the other definitions.
Hmm, are you saying that the 3rd argument to unlocked_ioctl is actually
(void __user *) instead of unsigned long?
--
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