Re: [PATCH] fuse: use kernel headers when __KERNEL__ is set

From: Colin Cross
Date: Tue Apr 16 2013 - 14:29:55 EST


On Tue, Apr 16, 2013 at 11:21 AM, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>> What I meant is IF <linux/fuse.h> is included by userspace (it sure is
>> meant to be included and *is* included by libfuse and other stuff)
>> THEN using <stdint.h> instead of <linux/types.h> is fine regardless of
>> whether __linux__ is defined or not.
>
> That's probably true. But the patch in question adds the __KERNEL__
> test, and *that* seems required.
>
> If you think that we should instead drop the __linux__ test, than yes,
> that part sounds fine. I thought that by "linux internal header" you
> meant the fuse.h file, but you seem to mean the indirectly included
> <inux/types.h>. That's fine.
>
> Linus

Dropping __linux__ causes a make headers_check warning, which the
kbuild test robot reported this morning:
usr/include/linux/fuse.h:99: found __[us]{8,16,32,64} type without
#include <linux/types.h>
Using my patch without modification does not cause that warning.

linux/types.h defines the types that are used to communicate between
the kernel and userspace. Redefining those in each header makes no
sense, and will probably cause redefined types warnings if you compile
a userspace file that includes fuse.h and another uapi header that
properly includes linux/types.h.
--
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/