[ovs-dev] [PATCH] hash: Add "fall through" annotations for 32-bit builds as well.

Ben Pfaff blp at ovn.org
Wed Aug 2 20:34:08 UTC 2017


This still needs a review.

On Thu, Jul 13, 2017 at 10:15:42AM -0700, Ben Pfaff wrote:
> Commit 73c7216a5329 ("Fix some -Wimplicit-fallthrough warnings building with
> GCC 7") missed a few fall through annotations that only appear in 32-bit
> builds.  This commit adds them.
> 
> CC: Timothy Redaelli <tredaelli at redhat.com>
> Signed-off-by: Ben Pfaff <blp at ovn.org>
> ---
>  lib/hash.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/lib/hash.c b/lib/hash.c
> index 321f9d927020..8ff9b1a2b7bc 100644
> --- a/lib/hash.c
> +++ b/lib/hash.c
> @@ -139,47 +139,61 @@ hash_bytes128(const void *p_, size_t len, uint32_t basis, ovs_u128 *out)
>      switch (len & 15) {
>      case 15:
>          k4 ^= tail[14] << 16;
> +        /* fall through */
>      case 14:
>          k4 ^= tail[13] << 8;
> +        /* fall through */
>      case 13:
>          k4 ^= tail[12] << 0;
>          k4 *= c4;
>          k4 = hash_rot(k4, 18);
>          k4 *= c1;
>          h4 ^= k4;
> +        /* fall through */
>  
>      case 12:
>          k3 ^= tail[11] << 24;
> +        /* fall through */
>      case 11:
>          k3 ^= tail[10] << 16;
> +        /* fall through */
>      case 10:
>          k3 ^= tail[9] << 8;
> +        /* fall through */
>      case 9:
>          k3 ^= tail[8] << 0;
>          k3 *= c3;
>          k3 = hash_rot(k3, 17);
>          k3 *= c4;
>          h3 ^= k3;
> +        /* fall through */
>  
>      case 8:
>          k2 ^= tail[7] << 24;
> +        /* fall through */
>      case 7:
>          k2 ^= tail[6] << 16;
> +        /* fall through */
>      case 6:
>          k2 ^= tail[5] << 8;
> +        /* fall through */
>      case 5:
>          k2 ^= tail[4] << 0;
>          k2 *= c2;
>          k2 = hash_rot(k2, 16);
>          k2 *= c3;
>          h2 ^= k2;
> +        /* fall through */
>  
>      case 4:
>          k1 ^= tail[3] << 24;
> +        /* fall through */
>      case 3:
>          k1 ^= tail[2] << 16;
> +        /* fall through */
>      case 2:
>          k1 ^= tail[1] << 8;
> +        /* fall through */
>      case 1:
>          k1 ^= tail[0] << 0;
>          k1 *= c1;
> -- 
> 2.10.2
> 


More information about the dev mailing list