Re: [PATCH/resend/bypass] um: Preinclude include/linux/kern_levels.h
From: Linus Torvalds
Date: Tue Sep 25 2012 - 15:21:12 EST
On Tue, Sep 25, 2012 at 12:11 PM, Geert Uytterhoeven
<geert@xxxxxxxxxxxxxx> wrote:
>
> To fix this:
> - Move the mapping from UM_KERN_<LEVEL> to KERN_<LEVEL> from
> arch/um/include/shared/common-offsets.h to
> arch/um/include/shared/user.h, which is preincluded for all userspace
> parts,
> - Preinclude include/linux/kern_levels.h for all userspace parts, to
> obtain the in-kernel KERN_<LEVEL> constant definitions. This doesn't
> violate the kernel/userspace separation, as include/linux/kern_levels.h
> is self-contained and doesn't expose any other kernel internals.
> - Remove the now unused STR() and DEFINE_STR() macros.
Ugh.
Why do you preinclude kern_levels.h instead of just having a
"#include" in user.h?
IOW, this part of the patch:
- c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) -include user.h
$(CFLAGS_$(basetarget).o)
+ c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) -include
$(srctree)/include/linux/kern_levels.h -include user.h
$(CFLAGS_$(basetarget).o)
just makes me go want to puke. The user.h file already has other
#include's in it, so I really don't see why you create this insane
special case.
And why does UM have those "UM_KERN_XYZ" defines in the first place?
Why isn't it just using KERN_XYZ directly? Is it because kern_levels.h
didn't use to exist, so it was some kind of "let's create our own that
we can hide in our special headers".
IOW, I really thinks this patch makes things uglier. At the very least
it could be done more prettily, but preferably we'd get rid of the odd
and useless UM_ prefix from these things entirely.
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/