From: David Miller <davem@davemloft.net>
To: xi.wang@gmail.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] ipv4: avoid undefined behavior in do_ip_setsockopt()
Date: Sun, 11 Nov 2012 17:50:56 -0500 (EST) [thread overview]
Message-ID: <20121111.175056.930119228369321440.davem@davemloft.net> (raw)
In-Reply-To: <50A0244F.1070302@gmail.com>
From: Xi Wang <xi.wang@gmail.com>
Date: Sun, 11 Nov 2012 17:18:55 -0500
> On 11/11/12 5:02 PM, David Miller wrote:
>>
>> This code is a fast bit test on purpose. You're making the
>> code slower.
>
> No, it's the opposite. All modern compilers optimize switch cases
> into a fast bit test.
Indeed, I even checked sparc64 with gcc-4.6 and it looks good.
Thanks for the clarification, I'll apply this, thanks.
next prev parent reply other threads:[~2012-11-11 22:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-11 21:20 [PATCH] ipv4: avoid undefined behavior in do_ip_setsockopt() Xi Wang
2012-11-11 22:02 ` David Miller
2012-11-11 22:18 ` Xi Wang
2012-11-11 22:50 ` David Miller [this message]
2012-11-12 13:54 ` David Laight
2012-11-12 17:00 ` Xi Wang
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=20121111.175056.930119228369321440.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=xi.wang@gmail.com \
/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).