Re: [PATCH] cosa.h ioctl numbers

From: Linus Torvalds
Date: Thu Dec 02 2004 - 11:04:58 EST




On Thu, 2 Dec 2004, Andreas Schwab wrote:
>
> This has nothing to do with this, but everything to do with
> sizeof(sizeof(foo)) == sizeof(size_t). And COSAIODOWNLD does not expect a
> pointer to a pointer but a pointer to struct cosa_download, which means
> that _IOW('C',0xf2,struct cosa_download *) would be completely wrong
> anyway.

We have similar "broken due to historical reasons" in other places.
There's no good way to fix them up, and it doesn't really matter _what_
fake type you use, as long as it happens to be the same size as the
original broken type on all architectures where it matters.

We've done different things in the past depending on exactly what the
numbers have been. Sometimes "size_t" (to keep pointers happy on both
32-bit and 64-bit architectures), sometimes "int" or "u32" (when somebody
had used an array _member_ instead of the array, or just had the size
explicitly haldcoded as an integer number, and then "size_t" just made it
"sizeof(int)" etc).

Sounds like it doesn't much matter in this case, any of the above would
work.

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/