All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: "Pablo Neira Ayuso" <pablo@netfilter.org>
Cc: <kaber@trash.net>, <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH] xt_log.h: don't use xchg() for simple assignment
Date: Fri, 23 Mar 2012 10:14:11 +0000	[thread overview]
Message-ID: <4F6C5B03020000780007A7ED@nat28.tlf.novell.com> (raw)
In-Reply-To: <20120323100705.GA22309@1984>

>>> On 23.03.12 at 11:07, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> On Thu, Mar 08, 2012 at 09:45:44AM +0000, Jan Beulich wrote:
>> At least on ia64 the (bogus) use of xchg() here results in the compiler
>> warning about an unused expression result. As only an assignment is
>> intended here, convert it to such.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> 
>> ---
>>  include/net/netfilter/xt_log.h |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> --- 3.3-rc6/include/net/netfilter/xt_log.h
>> +++ 3.3-rc6-netfilter-xt_log-no-xchg/include/net/netfilter/xt_log.h
>> @@ -47,7 +47,7 @@ static void sb_close(struct sbuff *m)
>>  	if (likely(m != &emergency))
>>  		kfree(m);
>>  	else {
>> -		xchg(&emergency_ptr, m);
>> +		emergency_ptr = m;
> 
> That xchg is there for some reason. I think it's better if you just
> cast it to void.

If I knew the reason, I wouldn't mind doing so. But with no code
comment and nothing said in the corresponding commit message
I'm of the opinion that it is there just as a copy-and-paste result.

Jan


  reply	other threads:[~2012-03-23 10:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-08  9:45 [PATCH] xt_log.h: don't use xchg() for simple assignment Jan Beulich
2012-03-23 10:07 ` Pablo Neira Ayuso
2012-03-23 10:14   ` Jan Beulich [this message]
2012-03-23 11:51     ` Eric Dumazet
2012-03-26 12:18       ` 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=4F6C5B03020000780007A7ED@nat28.tlf.novell.com \
    --to=jbeulich@suse.com \
    --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.