]> git.neil.brown.name Git - history.git/commit
[PATCH] use size_t for the broken ioctl numbers
authorMatthew Wilcox <willy@debian.org>
Sun, 7 Sep 2003 02:43:46 +0000 (19:43 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Sun, 7 Sep 2003 02:43:46 +0000 (19:43 -0700)
commit015e32c130300605f288fe21f9ac98a0bf687fbf
tree95daf4c35eef0fe966df6d3dcddcf0e2dd3c63d8
parent79b8787e3b3ee7d333e9b7eb7f49cfb92a9d0ffd
[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.
Documentation/ioctl-number.txt
include/linux/coda.h
include/linux/fs.h
include/linux/i8k.h
include/linux/if_pppox.h
include/linux/input.h
include/linux/matroxfb.h
include/linux/pmu.h
include/linux/radeonfb.h