linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Minchan Kim <minchan@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] vmalloc: remove #ifdef in function body
Date: Tue, 20 Dec 2011 22:27:09 -0800	[thread overview]
Message-ID: <1324448829.21735.4.camel@joe2Laptop> (raw)
In-Reply-To: <20111221060739.GD28505@barrios-laptop.redhat.com>

On Wed, 2011-12-21 at 15:07 +0900, Minchan Kim wrote:
> On Tue, Dec 20, 2011 at 09:58:19PM -0800, Joe Perches wrote:
> > On Wed, 2011-12-21 at 14:45 +0900, Minchan Kim wrote:
> > > On Tue, Dec 20, 2011 at 09:31:21PM -0800, Joe Perches wrote:
> > > > On Wed, 2011-12-21 at 14:17 +0900, Minchan Kim wrote:
> > > > > We don't like function body which include #ifdef.
> > []
> > > > I don't like this change.
> > > > I think it's perfectly good style to use:
> > > I feel it's no problem as it is because it's very short function now
> > > but it's not style we prefer. 
> > Who is this "we" you refer to?
> > There's nothing suggesting your patch as a preferred style
> > in Documentation/CodingStyle.
> Yes. It doesn't have. 
> But I have thought we have done until now.

But whoever this "we" you're referring to hasn't
actually done so.

> I think we can see them easily.
> 
> #> grep -nRH 'static inline void' ./ | grep {} | wc -l
> 936
> 
> If we consider line which don't include brace in one line, it would be many.

Try:

$ grep -rP --include=*.[ch] \
  '^(static|)\s*(inline|)\s*void\b[^\n;]+\n(?:{\s*|)\#\s*if' * | \
  wc -l
3603

A rough approximation would be to divide by 3.
So there's maybe a 1000 or so of the other style too.

cheers, Joe

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-12-21  6:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-21  5:17 Minchan Kim
2011-12-21  5:31 ` Joe Perches
2011-12-21  5:45   ` Minchan Kim
2011-12-21  5:58     ` Joe Perches
2011-12-21  6:07       ` Minchan Kim
2011-12-21  6:27         ` Joe Perches [this message]
2011-12-21  6:21       ` Michal Nazarewicz
2011-12-21  6:32         ` Joe Perches
2011-12-21  6:47           ` Michal Nazarewicz
2011-12-21 15:21             ` Ted Ts'o
2011-12-21  6:13 ` Michal Nazarewicz
2011-12-21  6:22   ` Minchan Kim
2011-12-21  6:24     ` Michal Nazarewicz

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=1324448829.21735.4.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox