Subject: Re: [PATCH] ipv4: avoid undefined behavior in do_ip_setsockopt()

From: Xi Wang <[email-masked]>
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.  The original "smarter" code, however, hinders
the compiler determining the mask for a fast bit test.  With this
patch, GCC is able to compute a better mask.  You can check the
assembly.

- xi