lkml.org 
[lkml]   [2009]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [GIT PULL -tip] fix 41 'make headers_check' warnings
On Sun, Jan 18, 2009 at 01:57:22PM +0100, Sam Ravnborg wrote:
> On Sun, Jan 18, 2009 at 12:02:21PM +0100, Ingo Molnar wrote:
> >
> > * Jaswinder Singh Rajput <jaswinder@kernel.org> wrote:
> >
> > > diff --git a/include/linux/acct.h b/include/linux/acct.h
> > > index 882dc72..a20c97c 100644
> > > --- a/include/linux/acct.h
> > > +++ b/include/linux/acct.h
> > > @@ -59,9 +59,13 @@ struct acct
> > > comp_t ac_majflt; /* Major Pagefaults */
> > > comp_t ac_swaps; /* Number of Swaps */
> > > /* m68k had no padding here. */
> > > -#if !defined(CONFIG_M68K) || !defined(__KERNEL__)
> > > +#ifdef __KERNEL__
> > > +#ifndef CONFIG_M68K
> > > __u16 ac_ahz; /* AHZ */
> > > -#endif
> > > +#endif /* CONFIG_M68K */
> > > +#else /* __KERNEL__ */
> > > + __u16 ac_ahz; /* AHZ */
> > > +#endif /* __KERNEL__ */
> >
> > that looks rather ugly.
> >
> > Why not just flip it around to:
> >
> > #if !defined(__KERNEL__) || !defined(CONFIG_M68K)
> >
> > ? Does headers_check misinterpret that?
>
> The original expression is misinterpreted by headers_check
> because we want the ac_ahz to stay if either of __KERNEL__
> or CONFIG_M68K is not defined.
> And unifdef does not optimize away the !defined(CONFIG_M68K)
> part - it has no knowledge that this is kernel internal.
>
> So I am happy with Jaswinder's patch.
Almost happy.
I digged out my original patch and it looks like this:
-#if !defined(CONFIG_M68K) || !defined(__KERNEL__)
+#ifndef __KERNEL__
__u16 ac_ahz; /* AHZ */
+#else
+ #ifndef CONFIG_M68K
+ __u16 ac_ahz; /* AHZ */
+ #endif
#endif

The indention can be discussed..
But the logic is simpler.

Sam


\
 
 \ /
  Last update: 2009-01-18 14:01    [W:0.092 / U:3.892 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site