All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Whitcroft <apw@shadowen.org>
To: Joel Schopp <jschopp@austin.ibm.com>,
	Dan Williams <dan.j.williams@intel.com>
Cc: rdunlap@xenotime.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] checkpatch: add an exclusion for 'for_each' helper macros
Date: Sat, 09 Jun 2007 15:06:04 +0100	[thread overview]
Message-ID: <466AB3CC.5020802@shadowen.org> (raw)
In-Reply-To: <466995DB.6080703@austin.ibm.com>

Joel Schopp wrote:
> 
> Dan Williams wrote:
>> checkpatch currently complains about macros like the following:
>>
>> #define for_each_dma_cap_mask(cap, mask) \
>>     for ((cap) = first_dma_cap(mask);       \
>>         (cap) < DMA_TX_TYPE_END;        \
>>         (cap) = next_dma_cap((cap), (mask)))
>>
>>
>> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> 
> I'd like it if this patch updated Chapter 12 of
> Documentation/CodingStyle as well. That section is where the rule to
> check came from and it would be nice for it to mention the exception to
> the rule as well.
> 
> 
> 

The actual restriction is on statements not on lines it seems:

"Macros with multiple statements should be enclosed in a do - while block"

So if this is only a single statement it is safe without a "container".
 I have a patch cooked up here which works out if there are more than
one statement which seems to do the trick.

Dan, thanks for the report.

-apw

      reply	other threads:[~2007-06-09 14:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-08 17:11 [PATCH] checkpatch: add an exclusion for 'for_each' helper macros Dan Williams
2007-06-08 17:46 ` Joel Schopp
2007-06-09 14:06   ` Andy Whitcroft [this message]

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=466AB3CC.5020802@shadowen.org \
    --to=apw@shadowen.org \
    --cc=dan.j.williams@intel.com \
    --cc=jschopp@austin.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    /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.