From: Jaswinder Singh Rajput <jaswinder@kernel.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Sam Ravnborg <sam@ravnborg.org>,
Andrew Morton <akpm@linux-foundation.org>,
x86 maintainers <x86@kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [GIT PULL -tip] fix 41 'make headers_check' warnings
Date: Wed, 21 Jan 2009 06:28:35 +0530 [thread overview]
Message-ID: <1232499515.3123.41.camel@localhost.localdomain> (raw)
In-Reply-To: <20090118172908.GC22624@elte.hu>
On Sun, 2009-01-18 at 18:29 +0100, Ingo Molnar wrote:
> * Sam Ravnborg <sam@ravnborg.org> wrote:
>
> > 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.
>
> yes - that's the 3-block versus 2-block issue i mentioned to Jaswinder.
> (the first version duplicated the same thing into 3 places - while the
> logic only splits it in two)
my 7 lines patch was:
#ifdef __KERNEL__
#ifndef CONFIG_M68K
__u16 ac_ahz; /* AHZ */
#endif /* CONFIG_M68K */
#else /* __KERNEL__ */
__u16 ac_ahz; /* AHZ */
#endif /* __KERNEL__ */
and Sam's 7 line patch is:
#ifndef __KERNEL__
__u16 ac_ahz; /* AHZ */
#else
#ifndef CONFIG_M68K
__u16 ac_ahz; /* AHZ */
#endif
#endif
Ingo, please apply the patch which one you like, I just want to get rid of this warning ;-)
Thanks,
--
JSR
next prev parent reply other threads:[~2009-01-21 0:59 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-18 10:10 [GIT PULL -tip] fix 41 'make headers_check' warnings Jaswinder Singh Rajput
2009-01-18 11:02 ` Ingo Molnar
2009-01-18 11:26 ` Jaswinder Singh Rajput
2009-01-18 12:26 ` Ingo Molnar
2009-01-18 12:57 ` Sam Ravnborg
2009-01-18 13:00 ` Sam Ravnborg
2009-01-18 17:29 ` Ingo Molnar
2009-01-21 0:58 ` Jaswinder Singh Rajput [this message]
2009-01-21 1:27 ` Jaswinder Singh Rajput
2009-01-21 5:53 ` Size of sector_t in userspace [Was: fix 41 'make headers_check' warnings] Sam Ravnborg
2009-01-21 8:21 ` Jens Axboe
2009-01-21 11:34 ` Sam Ravnborg
2009-01-18 22:39 ` [GIT PULL -tip] fix 41 'make headers_check' warnings Stephen Rothwell
2009-01-19 1:20 ` Sam Ravnborg
2009-01-18 22:50 ` Stephen Rothwell
2009-01-19 2:30 ` Jaswinder Singh Rajput
2009-01-19 3:53 ` Stephen Rothwell
2009-01-18 23:53 ` Stephen Rothwell
2009-01-19 2:31 ` Jaswinder Singh Rajput
2009-01-19 3:48 ` Stephen Rothwell
2009-01-19 5:16 ` Jaswinder Singh Rajput
2009-01-18 23:59 ` Stephen Rothwell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1232499515.3123.41.camel@localhost.localdomain \
--to=jaswinder@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=sam@ravnborg.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.