diff options
| author | Matthew Wilcox <willy@debian.org> | 2003-09-06 19:43:46 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-09-06 19:43:46 -0700 |
| commit | 015e32c130300605f288fe21f9ac98a0bf687fbf (patch) | |
| tree | 95daf4c35eef0fe966df6d3dcddcf0e2dd3c63d8 /include/linux/input.h | |
| parent | 79b8787e3b3ee7d333e9b7eb7f49cfb92a9d0ffd (diff) | |
[PATCH] use size_t for the broken ioctl numbers
The ioctl number-generating macros should be used like
#define XXXX _IOR(n,x,type-of-arg)
which generates an ioctl number that has the size of the argument
encoded within it. But there are a number of ioctl #defines that look
like
#define XXXX _IOR(n,x,sizeof(type-of-arg))
which is very wrong: the _IO/_IOR/_IOW/_IOWR macros will do the sizeof()
on the argtype themselves, so the end result is that we will be doing a
sizeof(sizeof(argtype)), ie a sizeof(size_t).
In other words, the argtype didn't matter at all, and ended up totally
pointless.
Clearly it's too late to change the ioctl definitions, but we can at
least stop people from copying them and making the same mistake.
Diffstat (limited to 'include/linux/input.h')
| -rw-r--r-- | include/linux/input.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/input.h b/include/linux/input.h index da49f7ee0f18..770644b05c59 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -73,7 +73,7 @@ struct input_absinfo { #define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */ #define EVIOCSABS(abs) _IOW('E', 0xc0 + abs, struct input_absinfo) /* set abs value/limits */ -#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */ +#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, size_t) /* send a force effect to a force feedback device */ #define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */ #define EVIOCGEFFECTS _IOR('E', 0x84, int) /* Report number of effects playable at the same time */ |
