Re: Linux 3.3-rc5

From: Linus Torvalds
Date: Tue Feb 28 2012 - 14:39:28 EST


On Tue, Feb 28, 2012 at 11:29 AM, Andreas Schwab <schwab@xxxxxxxxxxxxxx> wrote:
>
> 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).

Ahh, yes. That wasn't the only driver that did the "sizeof" by hand,
and as a result got "size_t" when the (nested) *real* sizeof then
happened.

That explains the history behind the garbage.

ioctl numbering have always been pretty painful. Oh, how I wish they
had been ASCII strings rather than random binary blobs. But that's the
way things are (and we certainly screwed up a few /proc files too, so
it's not like using text fixes all potential for screwing up)

Linus
--
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/