From patchwork Wed Jul 12 04:19:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 9835877 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5E459602BD for ; Wed, 12 Jul 2017 04:26:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46D1B205F6 for ; Wed, 12 Jul 2017 04:26:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39B94204BA; Wed, 12 Jul 2017 04:26:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 489EB26538 for ; Wed, 12 Jul 2017 04:26:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755899AbdGLE0Y (ORCPT ); Wed, 12 Jul 2017 00:26:24 -0400 Received: from mx3.wp.pl ([212.77.101.10]:38618 "EHLO mx3.wp.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755585AbdGLE0X (ORCPT ); Wed, 12 Jul 2017 00:26:23 -0400 Received: (wp-smtpd smtp.wp.pl 32050 invoked from network); 12 Jul 2017 06:19:42 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1499833182; bh=hm0INSkmJJ70GYKSK4fEMI27qoNsebeM9GVFf4Ic4BY=; h=From:To:Cc:Subject; b=ILzAkUhRBnNoXVGG4XXB0n6EhVBdFvkpIF+Eyx6QKCEoM23w/5xPN1stYzVqScReN IzVlMoMuwruAD96BUTxzi0/fELWc7Agu3WPcOhJaVdNjNT4xEsVWyjvjwVvlvaoxw0 DNN3kdvLJ2jZUSeVoHbmmnlf2XJeW0IIbqJPeoA4= Received: from unknown (HELO cakuba.netronome.com) (kubakici@wp.pl@[75.53.12.129]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 12 Jul 2017 06:19:42 +0200 Date: Tue, 11 Jul 2017 21:19:33 -0700 From: Jakub Kicinski To: Linus Torvalds Cc: Tejun Heo , Jean Delvare , Guenter Roeck , Bartlomiej Zolnierkiewicz , Sathya Prakash , "James E.J. Bottomley" , Greg Kroah-Hartman , "the arch/x86 maintainers" , xen-devel , linux-block , Linux Media Mailing List , IDE-ML , "linux-fbdev@vger.kernel.org" , Network Development Subject: Re: Lots of new warnings with gcc-7.1.1 Message-ID: <20170711211933.388e2816@cakuba.netronome.com> In-Reply-To: References: MIME-Version: 1.0 X-WP-MailID: 920f6fdd924ed1293421162d9f7974f9 X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 0000000 [0XNM] Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, 11 Jul 2017 15:35:15 -0700, Linus Torvalds wrote: > I do suspect I'll make "-Wformat-truncation" (as opposed to > "-Wformat-overflow") be a "V=1" kind of warning. But let's see how > many of these we can fix, ok? Somehow related - what's the stand on -Wimplicit-fallthrough? I run into the jump tables in jhash.h generating lots of warnings. Is it OK to do this? --->8------ --- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/linux/jhash.h b/include/linux/jhash.h index 348c6f47e4cc..f6d6513a4c03 100644 --- a/include/linux/jhash.h +++ b/include/linux/jhash.h @@ -85,20 +85,19 @@ static inline u32 jhash(const void *key, u32 length, u32 initval) k += 12; } /* Last block: affect all 32 bits of (c) */ - /* All the case statements fall through */ switch (length) { - case 12: c += (u32)k[11]<<24; - case 11: c += (u32)k[10]<<16; - case 10: c += (u32)k[9]<<8; - case 9: c += k[8]; - case 8: b += (u32)k[7]<<24; - case 7: b += (u32)k[6]<<16; - case 6: b += (u32)k[5]<<8; - case 5: b += k[4]; - case 4: a += (u32)k[3]<<24; - case 3: a += (u32)k[2]<<16; - case 2: a += (u32)k[1]<<8; - case 1: a += k[0]; + case 12: c += (u32)k[11]<<24; /* fall through */ + case 11: c += (u32)k[10]<<16; /* fall through */ + case 10: c += (u32)k[9]<<8; /* fall through */ + case 9: c += k[8]; /* fall through */ + case 8: b += (u32)k[7]<<24; /* fall through */ + case 7: b += (u32)k[6]<<16; /* fall through */ + case 6: b += (u32)k[5]<<8; /* fall through */ + case 5: b += k[4]; /* fall through */ + case 4: a += (u32)k[3]<<24; /* fall through */ + case 3: a += (u32)k[2]<<16; /* fall through */ + case 2: a += (u32)k[1]<<8; /* fall through */ + case 1: a += k[0]; /* fall through */ __jhash_final(a, b, c); case 0: /* Nothing left to add */ break; @@ -131,11 +130,11 @@ static inline u32 jhash2(const u32 *k, u32 length, u32 initval) k += 3; } - /* Handle the last 3 u32's: all the case statements fall through */ + /* Handle the last 3 u32's */ switch (length) { - case 3: c += k[2]; - case 2: b += k[1]; - case 1: a += k[0]; + case 3: c += k[2]; /* fall through */ + case 2: b += k[1]; /* fall through */ + case 1: a += k[0]; /* fall through */ __jhash_final(a, b, c); case 0: /* Nothing left to add */ break;