Yes, this looks much more sane. If you _really_ want to be anal about
typechecking (and also checking that nobody can possibly use a user
pointer incorrectly), you make
typedef struct {
unsigned int val;
} compat_uptr_t;
and then use
static inline void *compat_ptr(compat_uptr_t uptr)
{
return (void *)uptr.val;
}
which should still result in readable code.
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/