Re: [PATCH] ethtool.h should use userspace-accessible types

From: Tim Hockin
Date: Fri Mar 12 2004 - 04:23:00 EST


On Thu, Mar 11, 2004 at 08:57:56PM -0800, Greg KH wrote:
> u8 means an unsigned 8 bit variable within the kernel.
> __u8 means an unsigned 8 bit variable both within the kernel and
> in userspace. Use the __ forms when describing data structures
> or variables that cross the userspace/kernelspace boundry in
> order to get everything correct.

The only problem is that this is a RETARDED precedent. __foo means the
"internal" version of foo. Within the kernel __foo often means the version
of foo without "the lock".

POSIX defines any type beginning with _ as part of the implementation.
IMHO, no userspace app should *ever* need a type that starts with _ or __.
It's just dumb. If the width matters, define it as a width specific type.
If it doesn't define it as an int/short/whatever. The fact that it isn't
obvious what is or is not kernel-only is an entirely separate issue.

> Becides, something like u8 is a zillion times saner than uint8_t, don't
> you think? :)

As much as uint8_t is a pain in the ass to type, at least it is clear and
obvious and standard, don't you think? :)

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