Re: Linux 3.3-rc5

From: Andreas Schwab
Date: Tue Feb 28 2012 - 14:29:06 EST


Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> writes:

> I also think that your explanation is wrong. The problem is not the
> use of _IOR() at all, the problem is that the data structure given
> *to* the _IOR() macro is complete grabage. For example:
>
> #define I8K_GET_SPEED _IOWR('i', 0x85, size_t)

Originally the garbage looked like this:

#define I8K_BIOS_VERSION _IOR ('i', 0x80, 4)
#define I8K_MACHINE_ID _IOR ('i', 0x81, 16)
#define I8K_POWER_STATUS _IOR ('i', 0x82, sizeof(int))
#define I8K_FN_STATUS _IOR ('i', 0x83, sizeof(int))
#define I8K_GET_TEMP _IOR ('i', 0x84, sizeof(int))
#define I8K_GET_SPEED _IOWR('i', 0x85, sizeof(int))
#define I8K_GET_FAN _IOWR('i', 0x86, sizeof(int))
#define I8K_SET_FAN _IOWR('i', 0x87, sizeof(int)*2)

Later they were modified by "[PATCH] use size_t for the broken ioctl
numbers" and "Fix more ioctl _IOR/_IOW misusage." (see tglx's history
tree).

Andreas.

--
Andreas Schwab, schwab@xxxxxxxxxxxxxx
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
--
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/