public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: Christer Weinigel <christer@weinigel.se>
Cc: Andy Whitcroft <apw@uk.ibm.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] teach checkpatch.pl about list_for_each
Date: Sun, 2 Dec 2007 11:24:40 -0200	[thread overview]
Message-ID: <20071202132440.GM30008@ghostprotocols.net> (raw)
In-Reply-To: <20071202130335.690a8daf@cw05lap>

Em Sun, Dec 02, 2007 at 01:03:35PM +0100, Christer Weinigel escreveu:
> Hi Andy,
> 
> you seem to be the last person messing around with checkpatch.pl so I'm
> addressing this to you. :-)
> 
> checkpatch complains about the following:
> 
> WARNING: no space between function name and open parenthesis '('
> #520: FILE: drivers/spi/spi_s3c24xx_dma.c:478:
> +       list_for_each_entry (transfer, &message->transfers, transfer_list) {
> 
> which I think is a bit bogus since it actually is a for statement in
> disguise.  The following patch adds list_for_each to the list of things
> that look like functions that it shouldn't complain about.

Then you would have to do this for tons other *_for_each*, such as
hlist_for_each, etc, but:

[acme@doppio net-2.6.25]$ find . -name "*.[ch]" | xargs grep
'_for_each[a-z_]*(' | wc -l
4370
[acme@doppio net-2.6.25]$ find . -name "*.[ch]" | xargs grep
'_for_each[a-z_]* (' | wc -l
160
[acme@doppio net-2.6.25]$

I'd say that the common practice in the * _for_each_* use is to do just
what checkpatch does right now, complain if the is a space. Ah, and that
is also my personal preference 8-)

- Arnaldo

  reply	other threads:[~2007-12-02 13:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-02 12:03 [PATCH] teach checkpatch.pl about list_for_each Christer Weinigel
2007-12-02 13:24 ` Arnaldo Carvalho de Melo [this message]
2007-12-02 19:47 ` Valdis.Kletnieks
2008-01-03 11:10 ` Andy Whitcroft
2008-01-03 12:26   ` Christoph Hellwig
2008-01-03 12:30     ` Arnaldo Carvalho de Melo
2008-01-03 15:17       ` Benny Halevy
2008-01-03 23:12         ` Christer Weinigel
2008-01-03 11:23 ` pHilipp Zabel
2008-01-03 12:34 ` Tomas Carnecky
2008-01-03 23:10   ` Christer Weinigel

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=20071202132440.GM30008@ghostprotocols.net \
    --to=acme@redhat.com \
    --cc=apw@uk.ibm.com \
    --cc=christer@weinigel.se \
    --cc=linux-kernel@vger.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