All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Duyck <alexander.h.duyck@redhat.com>
To: Jan Engelhardt <jengelh@inai.de>
Cc: Alexander Duyck <alexander.duyck@gmail.com>,
	Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>,
	netfilter-devel@vger.kernel.org, kaber@trash.net,
	pablo@netfilter.org
Subject: Re: [iptables PATCH] list: fix prefetch dummy
Date: Tue, 07 Apr 2015 12:29:25 -0700	[thread overview]
Message-ID: <55243015.8020402@redhat.com> (raw)
In-Reply-To: <alpine.LSU.2.20.1504072010530.17563@nerf40.vanv.qr>

On 04/07/2015 11:17 AM, Jan Engelhardt wrote:
>
> On Tuesday 2015-04-07 19:45, Alexander Duyck wrote:
>>>>>   -#define prefetch(x)		1
>>>>> +#define prefetch(x)		((void)0)
>>>>>
>>>> Why not just use "do {} while (0)"?  I know that is what is used in the
>>>> kernel for functions that don't do anything.
>>> I may be getting the terms wrong, but:
>>> do{}while(0) is not an expression, it is a (block) control statement.
>>> In particular, do{}while(0) won't evaluate to an rvalue.
>>
>> Right.  That is the point in this case.  I am assuming what Arturo is trying to
>> accomplish since you shouldn't be able to evaluate ((void)0) as an rvalue
>> either.
>
> The difference is that
>
> 	int i;
> 	i = 1, (void)0;
>
> compiles, while
>
> 	i = 1, do{}while(0);
>

Okay, that explains it.  It is being used inside the init, condition, 
and post process sections of a for loop.  Thanks for explaining it.

- Alex

  reply	other threads:[~2015-04-07 19:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-06 18:05 [iptables PATCH] list: fix prefetch dummy Arturo Borrero Gonzalez
2015-04-07  0:38 ` Alexander Duyck
2015-04-07  8:37   ` Jan Engelhardt
2015-04-07 17:45     ` Alexander Duyck
2015-04-07 18:17       ` Jan Engelhardt
2015-04-07 19:29         ` Alexander Duyck [this message]
2015-04-08 17:04 ` Pablo Neira Ayuso
2015-04-09  0:18 ` Stephen Hemminger
2015-04-09 10:45   ` Pablo Neira Ayuso

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=55243015.8020402@redhat.com \
    --to=alexander.h.duyck@redhat.com \
    --cc=alexander.duyck@gmail.com \
    --cc=arturo.borrero.glez@gmail.com \
    --cc=jengelh@inai.de \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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.