Re: [PATCH] struct loop_info64

Linus Torvalds (torvalds@transmeta.com)
Fri, 18 Apr 2003 10:55:21 -0700 (PDT)


On Fri, 18 Apr 2003, Greg KH wrote:
> On Fri, Apr 18, 2003 at 09:26:08AM -0700, Linus Torvalds wrote:
> >
> > We should literally have the rule that any user-visible data structures
> > cannot use _any_ types other than u8/u16/u32/u64 (and _maybe_ the signed
> > ones, if there is any real reason to).
>
> I thought we did have such a rule. Well, it's unwritten I guess...

It's certainly been a suggested rule, but yes it's unwritten. And we've
never had a good rule for user pointers (ie right now everybody just has
"void *", which ends up always requireing explicit conversion).

> Oh, and shouldn't we be using the "__*" style types for crossing the
> user/kernel boundry (__u8, __u16, __u32, etc.)? I thought that is what
> those versions were for.

Yes, in header files they should always be the __xx versions.

But we really should have a __ptr64 type too. There's just no sane way to
tell gcc about it without requireing casts, which is inconvenient (which
means that right now it you just have to use __u64 for pointers if you
want to be able to share the structure across 32/64-bit architectures).

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/