[PATCH] perf_counter: fix ioctl()s

From: Peter Zijlstra
Date: Tue May 12 2009 - 06:59:59 EST


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@xxxxxxxxx>
---
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,

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/