Messages in this thread Patch in this message | | | Subject | [PATCH] perf_counter: fix ioctl()s | From | Peter Zijlstra <> | Date | Tue, 12 May 2009 12:59:33 +0200 |
| |
On Tue, 2009-05-12 at 09:52 +0200, Arnd Bergmann wrote: > On Tuesday 12 May 2009, Peter Zijlstra wrote: > > Ah, so _IO() gets an unsigned long 3rd argument. > > _IOW() treats the 3rd arg as a (type __user *) and copies the bits over > > _IOR() copies the bits back out to userspace > > _IORW() does both > > > > In which case the below should fix things up, no? > > > > Yes, this looks good now.
--- Arnd spotted that I misunderstood and wrongly used the 3rd ioctl argument. Fix up the perf counter ioctl()s to use the 3rd argument as value -- as opposed to a pointer as would now be the case.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> --- include/linux/perf_counter.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index 614f921..6a9cebc 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h @@ -159,10 +159,10 @@ struct perf_counter_hw_event { /* * Ioctls that can be done on a perf counter fd: */ -#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 _IOW('$', 3, u32) +#define PERF_COUNTER_IOC_ENABLE _IO('$', 0) +#define PERF_COUNTER_IOC_DISABLE _IO('$', 1) +#define PERF_COUNTER_IOC_REFRESH _IO('$', 2) +#define PERF_COUNTER_IOC_RESET _IO('$', 3) enum perf_counter_ioc_flags { PERF_IOC_FLAG_GROUP = 1U << 0,
| |