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: 9835889 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 2916C602BD for ; Wed, 12 Jul 2017 05:06:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D85D25EA6 for ; Wed, 12 Jul 2017 05:06:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01847285D5; Wed, 12 Jul 2017 05:06:40 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3456A285DD for ; Wed, 12 Jul 2017 05:06:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dV9pN-0000yL-7e; Wed, 12 Jul 2017 05:04:45 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dV97o-0005Zs-S6 for xen-devel@lists.xenproject.org; Wed, 12 Jul 2017 04:19:45 +0000 Received: from [193.109.254.147] by server-3.bemta-6.messagelabs.com id 76/16-03044-063A5695; Wed, 12 Jul 2017 04:19:44 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrLIsWRWlGSWpSXmKPExsVyxTeVRzd+cWq kQetKJYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNePrNMmC7YIV6xe+ZG9gvMDbxcjJISQQJjFp 0n72LkYuDhaBRmaJ6S9aWEAcIYE5TBIzL05hA6liEVCVuLdoMSuIzQZk7z74CCwuImAk8fnFF VaQBmaBfywS24+vYQJJCAsYSHT9eAtm8wpYSRyc2gzWwCkQKHF+1yFWiNUBEj8697BD1AhKnJ z5hAXEZhbQknj46xaULS+x/e0cZhBbQkBX4tGZfWwQtqnEshurgOZzANnWEtcm20xgFJyFZNI sJJNmIZm0gJF5FaN6cWpRWWqRrrFeUlFmekZJbmJmjq6hgZlebmpxcWJ6ak5iUrFecn7uJkZg 0DIAwQ7Gjn9OhxglOZiURHl35KdGCvEl5adUZiQWZ8QXleakFh9ilOHgUJLgdVwElBMsSk1Pr UjLzAHGD0xagoNHSYTXOxoozVtckJhbnJkOkTrFqMtx5+T6L0xCLHn5ealS4ryqIDMEQIoySv PgRsBi+RKjrJQwLyPQUUI8BalFuZklqPKvGMU5GJWEeS1ApvBk5pXAbXoFdAQT0BFrslNAjih JREhJNTCm9FnPb2th9E70LpBYcebw6nV70nbac2tVTjbL2XxW8NijLVNYCqf5sjXEzzsucku1 Yl7xko3Xt2l6nPvhxqv+Ki7q98s+rZAv++d7qa70EvnwXpP9ocnvqA/eq4QmPft/4nHw+otVJ 3/ln7s/d8b6Yna2MLe5hyY8c10Vra5b4jGfbdfWK3pOSizFGYmGWsxFxYkAlYw39+ACAAA= X-Env-Sender: kubakici@wp.pl X-Msg-Ref: server-6.tower-27.messagelabs.com!1499833183!106886371!1 X-Originating-IP: [212.77.101.12] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 59453 invoked from network); 12 Jul 2017 04:19:43 -0000 Received: from mx4.wp.pl (HELO mx4.wp.pl) (212.77.101.12) by server-6.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 12 Jul 2017 04:19:43 -0000 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 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] X-Mailman-Approved-At: Wed, 12 Jul 2017 05:04:43 +0000 Cc: "linux-fbdev@vger.kernel.org" , Jean Delvare , "James E.J. Bottomley" , Bartlomiej Zolnierkiewicz , Greg Kroah-Hartman , Sathya Prakash , the arch/x86 maintainers , linux-block , IDE-ML , Network Development , Tejun Heo , xen-devel , Guenter Roeck , Linux Media Mailing List Subject: Re: [Xen-devel] Lots of new warnings with gcc-7.1.1 X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" 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------ 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;