linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Daney <ddaney@caviumnetworks.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-arch@vger.kernel.org
Subject: Re: [PATCH] Protect prefetch macro arguments.
Date: Fri, 26 Mar 2010 14:18:05 -0700	[thread overview]
Message-ID: <4BAD248D.7070603@caviumnetworks.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1003261402170.3721@i5.linux-foundation.org>

On 03/26/2010 02:04 PM, Linus Torvalds wrote:
>
>
> On Fri, 26 Mar 2010, David Daney wrote:
>>
>> The GCC built-in __builtin_prefetch() is a vargs function.  If we
>> don't wrap the macro parameter in parentheses, a comma operator in the
>> actual argument list might cause unintended parameters to be passed to
>> __builtin_prefetch().
>
> This seems totally pointless and actively wrong.

Pointless, perhaps.  But 'actively wrong'?  Are you sure about that?

In any event I guess I don't care much one way or the other.  I was 
working on something else when I saw this. It looked wrong to me.

Thanks,
David Daney


>
> You cannot have a comma operator in the actual argument list to the
> #define, because if you did, then you'd get a
>
> 	macro "prefetch()" passed 2 arguments, but takes just 1
>
> so the only way I see to pass a comma operator is to _already_ have the
> macro parameter in parenthesis.
>
> 		Linus

  reply	other threads:[~2010-03-26 21:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-26 20:44 [PATCH] Protect prefetch macro arguments David Daney
2010-03-26 21:04 ` Linus Torvalds
2010-03-26 21:18   ` David Daney [this message]
2010-03-26 21:23     ` Linus Torvalds

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=4BAD248D.7070603@caviumnetworks.com \
    --to=ddaney@caviumnetworks.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).