Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp140840pxu; Wed, 25 Nov 2020 15:35:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJzflkJXboEPrUkZqMZ95Wyf/T5mvxWGdDskSzGkrYDDzINdHrvfFYBVO446x6NL3/jzEOWJ X-Received: by 2002:a17:906:f87:: with SMTP id q7mr301402ejj.530.1606347354062; Wed, 25 Nov 2020 15:35:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606347354; cv=none; d=google.com; s=arc-20160816; b=iHEHfbWhYNqpYgbUeaBT6Drgo+R0lZNLgYtd0RFSBrOOWapHJaPiFtvxcV3njC/3py fxljk1dZFKHt7h/xvb0ErGmHiQ60eBsCdMbWbWNjrztvQkZ04JCO9SsnqW1mhx2zKlRp EHwnwuQTkadCzcliAbg7Pe6rRC1oexDrzKWtPnQLrv13WKZnDS5m/mRxvsbOPt7QDH8J KJFykJoQXAjNvqvgvpLCRWfC7N1NtwhrqMWuIp0wvR9kh2ai6nvh5gPEDEOuxueTitrW Df2cCn5eByvmyMxukoWKHbX0yKBbJtWSeB042noQkrF9xmVsCPENcK5tR0oNSgNHcLH0 acaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=mMrMdknFbsC77SFRvwwD3pm1cwl3V2MP65kzVJE6tY4=; b=KVNRPkL+kwOrhUU44mccoBInz6eFn1pWohckCdBa1smxv96eDOllfy7BgUup9rkXSz RtLCc2buWuUuZUzO6S92IcTxVKF00lIaL+NIYriPXbEN1VpnPs2OjHsV7sYxb07h7WJ9 nrLoqf9kQwgRd2ADVLBlh8VCBbEw2tDVyDOBrAyQoRscNQ82W9qM2B7Bh4jz7AmGRasz zdevAj6CNMAK25wu7sbTK9Ad+jZuvdv+VBNON0qGw7O3AzN58gJ8YMMWN2UckJuGkBVs HjoVqZro9M+tfEYzis7xdGegEmo5qSv0kU/8SIcE/vCmMUBCTEU7Nov5n6DKQTlvVSP6 BiOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="mE3/9/w1"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o60si2100105eda.61.2020.11.25.15.35.30; Wed, 25 Nov 2020 15:35:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="mE3/9/w1"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731578AbgKYWom (ORCPT + 99 others); Wed, 25 Nov 2020 17:44:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727070AbgKYWok (ORCPT ); Wed, 25 Nov 2020 17:44:40 -0500 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B6EAC0613D4; Wed, 25 Nov 2020 14:44:40 -0800 (PST) Received: by mail-wm1-x342.google.com with SMTP id a3so235503wmb.5; Wed, 25 Nov 2020 14:44:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=mMrMdknFbsC77SFRvwwD3pm1cwl3V2MP65kzVJE6tY4=; b=mE3/9/w1S1BsFafykdzrNl6nUKLQtv3irXzEz/AwtJdLppuZQnzVWeoYFC7Qb5OQef 2DAcZ7D6Froq/rlKPIBwqGtt0C/0XmhDJf/Ua0btTGl1wBl77rh04suLM7Drqc/fd1vb erjCUGXrwTRfKAEK60/5plkWP59Lm5M7QZ9ENMraFyUEU5TYdKtuuKGBjQ65xtLyj0UE nayIBzzwS8QdOAkDbWxTvDHZJGPoguOAiztDitejPSo1Rp931ceTN4KgHMls79AEVEp8 0UjkiGW0It0CwNfB/koaXcS1sEgjLFm2K1jcT9QDdZUmcgiCMPoll+6KvJ2hAfFlaA1V 8PSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=mMrMdknFbsC77SFRvwwD3pm1cwl3V2MP65kzVJE6tY4=; b=s3HcFD83fswtv3xvGmOKykyMAbTuH/ZoyjV3bPHw150+3A3e+YcTmOGSNT84yiP9Fq a53GJBddq9sm0yHCm1NvRBIt3cuyTkKRd7gD0orWSb0aZw+klHh3qRu1xrNVKHFfD2P0 AHSYyHrv14FMkJrR0jamTs138Hrue1uqlsoTWzKYDF0rnG2HwEwBAe0EGCoJm2CzGqYx RP9Qet/wa23vNr0rQhh7aio4RIZ9FbZfzWlEm6UQYIA7tzaN/oIbrN3pD13XomRhZyht zgXrdFOAW2MluLB12hXnI+LCZX2y9/NCkUEYW/xym28NIrHG/+re/xtQnppkq6ZoTzKO 0v7w== X-Gm-Message-State: AOAM5306KaR62FxidIA4MvAnzNNbxk+AXgwBl/AuBgU3QdG21VBjl02t SbyQQELzAa+AQZgRzuCzZ1A= X-Received: by 2002:a7b:cf0a:: with SMTP id l10mr6364382wmg.103.1606344279394; Wed, 25 Nov 2020 14:44:39 -0800 (PST) Received: from [192.168.1.122] (cpc92720-cmbg20-2-0-cust364.5-4.cable.virginm.net. [82.21.83.109]) by smtp.gmail.com with ESMTPSA id h15sm6411655wrw.15.2020.11.25.14.44.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Nov 2020 14:44:38 -0800 (PST) Subject: Re: [PATCH 000/141] Fix fall-through warnings for Clang To: Miguel Ojeda , James Bottomley Cc: Kees Cook , Jakub Kicinski , "Gustavo A. R. Silva" , linux-kernel , alsa-devel@alsa-project.org, amd-gfx@lists.freedesktop.org, bridge@lists.linux-foundation.org, ceph-devel@vger.kernel.org, cluster-devel@redhat.com, coreteam@netfilter.org, devel@driverdev.osuosl.org, dm-devel@redhat.com, drbd-dev@lists.linbit.com, dri-devel@lists.freedesktop.org, GR-everest-linux-l2@marvell.com, GR-Linux-NIC-Dev@marvell.com, intel-gfx@lists.freedesktop.org, intel-wired-lan@lists.osuosl.org, keyrings@vger.kernel.org, linux1394-devel@lists.sourceforge.net, linux-acpi@vger.kernel.org, linux-afs@lists.infradead.org, Linux ARM , linux-arm-msm@vger.kernel.org, linux-atm-general@lists.sourceforge.net, linux-block@vger.kernel.org, linux-can@vger.kernel.org, linux-cifs@vger.kernel.org, Linux Crypto Mailing List , linux-decnet-user@lists.sourceforge.net, Ext4 Developers List , linux-fbdev@vger.kernel.org, linux-geode@lists.infradead.org, linux-gpio@vger.kernel.org, linux-hams@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-i3c@lists.infradead.org, linux-ide@vger.kernel.org, linux-iio@vger.kernel.org, linux-input , linux-integrity@vger.kernel.org, linux-mediatek@lists.infradead.org, Linux Media Mailing List , linux-mmc@vger.kernel.org, Linux-MM , linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-scsi@vger.kernel.org, linux-sctp@vger.kernel.org, linux-security-module@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-wireless , Network Development , netfilter-devel@vger.kernel.org, nouveau@lists.freedesktop.org, op-tee@lists.trustedfirmware.org, oss-drivers@netronome.com, patches@opensource.cirrus.com, rds-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, samba-technical@lists.samba.org, selinux@vger.kernel.org, target-devel@vger.kernel.org, tipc-discussion@lists.sourceforge.net, usb-storage@lists.one-eyed-alien.net, virtualization@lists.linux-foundation.org, wcn36xx@lists.infradead.org, "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , xen-devel@lists.xenproject.org, linux-hardening@vger.kernel.org, Nick Desaulniers , Nathan Chancellor , Miguel Ojeda , Joe Perches References: <20201120105344.4345c14e@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <202011201129.B13FDB3C@keescook> <20201120115142.292999b2@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <202011220816.8B6591A@keescook> <9b57fd4914b46f38d54087d75e072d6e947cb56d.camel@HansenPartnership.com> <1c7d7fde126bc0acf825766de64bf2f9b888f216.camel@HansenPartnership.com> <4993259d01a0064f8bb22770503490f9252f3659.camel@HansenPartnership.com> From: Edward Cree Message-ID: <44005bde-f6d4-5eaa-39b8-1a5efeedb2d3@gmail.com> Date: Wed, 25 Nov 2020 22:44:35 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 25/11/2020 00:32, Miguel Ojeda wrote: > I have said *authoring* lines of *this* kind takes a minute per line. > Specifically: lines fixing the fallthrough warning mechanically and > repeatedly where the compiler tells you to, and doing so full-time for > a month. > It is useful since it makes intent clear. To make the intent clear, you have to first be certain that you understand the intent; otherwise by adding either a break or a fallthrough to suppress the warning you are just destroying the information that "the intent of this code is unknown". Figuring out the intent of a piece of unfamiliar code takes more than 1 minute; just because case foo: thing; case bar: break; produces identical code to case foo: thing; break; case bar: break; doesn't mean that *either* is correct — maybe the author meant to write case foo: return thing; case bar: break; and by inserting that break you've destroyed the marker that would direct someone who knew what the code was about to look at that point in the code and spot the problem. Thus, you *always* have to look at more than just the immediate mechanical context of the code, to make a proper judgement that yes, this was the intent. If you think that that sort of thing can be done in an *average* time of one minute, then I hope you stay away from code I'm responsible for! One minute would be an optimistic target for code that, as the maintainer, one is already somewhat familiar with. For code that you're seeing for the first time, as is usually the case with the people doing these mechanical fix-a-warning patches, it's completely unrealistic. A warning is only useful because it makes you *think* about the code. If you suppress the warning without doing that thinking, then you made the warning useless; and if the warning made you think about code that didn't *need* it, then the warning was useless from the start. So make your mind up: does Clang's stricter -Wimplicit-fallthrough flag up code that needs thought (in which case the fixes take effort both to author and to review) or does it flag up code that can be mindlessly "fixed" (in which case the warning is worthless)? Proponents in this thread seem to be trying to have it both ways. -ed