Received: by 10.223.164.202 with SMTP id h10csp3366109wrb; Tue, 28 Nov 2017 10:07:35 -0800 (PST) X-Google-Smtp-Source: AGs4zMZyEZtNBnmem05xq5BoXRU08+720SP/eyawgkWhjsyQzO54pE4s3xkiM2zZrxqkUwNFyHtA X-Received: by 10.99.149.65 with SMTP id t1mr27321235pgn.101.1511892455809; Tue, 28 Nov 2017 10:07:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511892455; cv=none; d=google.com; s=arc-20160816; b=OqK8NPddqCZtRFFjKAk3GUUkKqU8khqOXg2ewKFrPLZ6prqjhBu2ab35RHwxG+JKen l54QuVoEPar838cWuXN6frIer1TOCbe/E+pw5Mqk9M8IT5wc1wlibzMDoHAMIx8m89U7 oa0keAHl3s/dSFxzVHPiEHUr4cGOKhRDg9NEoBovpd+HA6rIHagTjmTDClAkWKmNdLQI IVWedS3PLOvyhMnI2ICUTVNY0rXyBEXE7Hb/RmdZq8dMkMUx4kPdcXdLuIj5QJ7H6DBN IsKTwR5L/j4T0Dqo4Ixi+h5KlniUG2M3+KTGdAehX8KPkdk1Tt/giuZfEhDSwMu4xsP1 1cZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :user-agent:in-reply-to:references:subject:cc:to:from:message-id :date:arc-authentication-results; bh=I9a6B3GOSCmubAnwAHw8/C8I6A6P7AZsNgnriAzjahY=; b=KlYF9aWdpeKy2Z2fCMxG8t0EfSb8y/VtbpMWGYq6ThAbQYUaUVPXMoZHGlceffRcyT 0zNduuG0NN0ZF03AwkO5HsLHEo8NKsBF474mJpzFDeDRljQy6UTyCBf873edvqzxksxD Rn6ic15fdOhrie/AaEFbSJg4XZhB0bhFkgdCCBuLZL1MudTymB4T0B/p1f+8u7HFg6UO cl1Ce3mNINohctShuuImcg5LSygDBi+fmZ7FBZhGiKS8Z75wx/onK0fhT6qS4cHeIhZ0 kv44uQvjw+tYmPZlhtEgt7gx2/iavm5IxVa367oirLu1m86ofOSxGoF5J+uQnz/FzqtU jQ0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d132si3095238pgc.187.2017.11.28.10.07.16; Tue, 28 Nov 2017 10:07:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753082AbdK1SFO (ORCPT + 78 others); Tue, 28 Nov 2017 13:05:14 -0500 Received: from gateway22.websitewelcome.com ([192.185.47.168]:18807 "EHLO gateway22.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752436AbdK1SFN (ORCPT ); Tue, 28 Nov 2017 13:05:13 -0500 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway22.websitewelcome.com (Postfix) with ESMTP id BF4BB291D8 for ; Tue, 28 Nov 2017 12:05:12 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id JkFsev1RWtuxmJkFseE3uV; Tue, 28 Nov 2017 12:05:12 -0600 Received: from gator4166.hostgator.com ([108.167.133.22]:44307) by gator4166.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89) (envelope-from ) id 1eJkFs-0020T6-AZ; Tue, 28 Nov 2017 12:05:12 -0600 Received: from 189.175.122.225 ([189.175.122.225]) by gator4166.hostgator.com (Horde Framework) with HTTPS; Tue, 28 Nov 2017 12:05:12 -0600 Date: Tue, 28 Nov 2017 12:05:12 -0600 Message-ID: <20171128120512.Horde.1mz61Up1PsNtyHbrjWmK8L7@gator4166.hostgator.com> From: "Gustavo A. R. Silva" To: Thomas Gleixner Cc: Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, Kees Cook Subject: Re: [PATCH] x86/syscalls: Mark expected switch fall-throughs References: <20171127235253.GA20384@embeddedor.com> In-Reply-To: User-Agent: Horde Application Framework 5 Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 108.167.133.22 X-Source-L: Yes X-Exim-ID: 1eJkFs-0020T6-AZ X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: gator4166.hostgator.com [108.167.133.22]:44307 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 2 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Thomas Gleixner : > On Mon, 27 Nov 2017, Gustavo A. R. Silva wrote: > >> In preparation to enabling -Wimplicit-fallthrough, mark switch cases >> where we are expecting to fall through. > >> case 0: >> if (!n--) break; >> *args++ = regs->bx; >> + /* fall through */ > > And these gazillions of pointless comments help enabling of > -Wimplicit-fallthrough in which way? > The -Wimplicit-fallthrough option was added to GCC 7. We want to add that option to the top-level Makefile so we can have the compiler help us not make mistakes as missing "break"s or "continue"s. This also documents the intention for humans and provides a way for analyzers to report issues or ignore False Positives. So prior to adding such option to the Makefile, we have to properly add a code comment wherever the code is intended to fall through. During the process of placing these comments I have identified actual bugs (missing "break"s/"continue"s) in a variety of components in the kernel, so I think this effort is valuable. Lastly, such a simple comment in the code can save a person plenty of time during a code review. Thanks -- Gustavo A. R. Silva From 1585317989981270721@xxx Tue Nov 28 13:50:50 +0000 2017 X-GM-THRID: 1585265423856272058 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread