Re: [PATCH] Speed up "make headers_*"

Oleg Verych
2008-06-08T12:23:26Z

> Correct. A quick grep shows that we have these different
> uses of __KERNEL__:
>
> #if defined(__ARM_EABI__) && !defined(__KERNEL__)
> #if !defined(CONFIG_M68K) || !defined(__KERNEL__)
> #if defined(CONFIG_VIDEO_V4L1_COMPAT) || !defined (__KERNEL__)
> #if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
> #if defined(__KERNEL__)

> #ifndef __KERNEL__
>
> #else and #endif filtered away.
>
> A script needs to take into account other preprocessor
> uses too due to their nested nature.
> But doable I'm sure.
>
> And I rather have 100 lines perl than use the unifdef utility
> because we then have it collected in one place and can do even
> stricter validation.

I've suggested some time ago to adopt a coding style for simple

#if defined(__KERNEL__)
#ifndef __KERNEL__

this will be much clearner as for developers to know the scope by
using simple /* __KERNEL__ */ /* !__KERNEL__ */, and `sed`
script for that would be from 1 to 4 lines.

--
sed 'sed && sh + olecom = love' << ''
-o--=O`C
#oo'L O
<___=E M