From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BFA8C4363A for ; Tue, 20 Oct 2020 13:57:12 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 02BA922240 for ; Tue, 20 Oct 2020 13:57:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ix+kuDYd"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ckht+6t3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 02BA922240 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RhxAYaqJixn2JUo8m0xwTRbCY1ENQKLYIbxWsq3YGO4=; b=Ix+kuDYdVGl9eW0H83ZvoxJPq kLFP5RoS4unh9efV/xhdQrAuTo2Orctje53FRUa8F/rUB86ZdWbN1QI71KsibjRazIgA1mqqV4VYF 5zVxKk6HFMMaYuGDqABQV8xlRl9/mLfeJAPplGTcKUSWG/F82Z+exGTiQwtAlOiwhRKxu4aF/6VLe Pkvpo+rJHntpsGTEQZTpJ/8wtco3mc3GolqglGpsIiZsAdzVbQ6fnFrE+RX42yZX+jt8GjUoeyhyH 8Rb/ERk74oSKVe50mkKPThaWHbbhM5Oo9E6f6Xj9JOaDYJJFhvYK6PZWl8r6x6nCfWAy3OrdzvFtK YtsLZoVIg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUs7V-0004HR-JK; Tue, 20 Oct 2020 13:56:09 +0000 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUs7R-0004Fi-7r for linux-mtd@lists.infradead.org; Tue, 20 Oct 2020 13:56:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603202164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HyQ28xr5/lapv6azTtFCvHFT5XQ1+OzeHk+84iEm66Y=; b=ckht+6t33lbUC2eMXrxd9VwzY1SOpc/b4diJYbQpU72IixDlBDYUWQX7nATvmzMyhJvlGC IVuENBfDXNLkiSfKYfYjMt0M/Tam/PAd5BPSqYozN2w89+68e8nWSkAGF5w4eJcfvUve2m TIFZJSbYBajL8w5CNz+PV0x6sMwdGvo= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-214-pl0xVFlTNG6wsODVpgutlA-1; Tue, 20 Oct 2020 09:56:01 -0400 X-MC-Unique: pl0xVFlTNG6wsODVpgutlA-1 Received: by mail-qv1-f71.google.com with SMTP id w1so1394795qvv.0 for ; Tue, 20 Oct 2020 06:56:01 -0700 (PDT) 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-transfer-encoding :content-language; bh=HyQ28xr5/lapv6azTtFCvHFT5XQ1+OzeHk+84iEm66Y=; b=aY4KsYJ42/txTppB42kpTzxYQ5lscloaYbmDt/qx3vy0IeeaTQk8KNS1hhlIn5w5I5 Ceu9M2fQY9CgyrqOUYIUw1PYyxLuu5mc10IAgXSsP/DXs6qi+r2mDV/PV5oS/rKpmnpZ WZ93JSA2op5gDcLnk6TUX4zoyzmFzNoIQgkBhB8ZadEtXQuOAamM+EjnIGIJjfhgN/wh rA+tgN9L61PAPiB/denqJPIvmAbUm/Vsp7liaStSBD1FO3ym/NPsyUIZ0tclKmuKxW0q 8dzZIbATqYqg5G4We15qh+G6WkO4QEXvGrzIs09rmMv6yyJlUZWX75e7njGcaTmDf4Vd e/jA== X-Gm-Message-State: AOAM531V64aN/h7/md99X2hz2M/H6AF/a4Wl513lU6QjHG8G/Z2hsgXb 9CQDXNroc9EIDLx4rdXLPf3p8k1UCdFPS0MhYtC8Tu9AgGrzAgOs7KXYPJBuUGfQqmVn+7bQEKb bbXzw3jjTeVtHJ4/6PtF001offA== X-Received: by 2002:a05:6214:174f:: with SMTP id dc15mr3370443qvb.25.1603202160688; Tue, 20 Oct 2020 06:56:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLUAfqrAOJzxwKF3+voCBF5yQYNbMOvfOkDZhumkJj3bEnT15V4x8vUJ5iQ5pWt9KusIZtsQ== X-Received: by 2002:a05:6214:174f:: with SMTP id dc15mr3370377qvb.25.1603202160139; Tue, 20 Oct 2020 06:56:00 -0700 (PDT) Received: from trix.remote.csb (075-142-250-213.res.spectrum.com. [75.142.250.213]) by smtp.gmail.com with ESMTPSA id b8sm775938qkn.133.2020.10.20.06.55.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Oct 2020 06:55:59 -0700 (PDT) Subject: Re: [RFC] treewide: cleanup unreachable breaks To: Nick Desaulniers References: <20201017160928.12698-1-trix@redhat.com> <20201018054332.GB593954@kroah.com> From: Tom Rix Message-ID: Date: Tue, 20 Oct 2020 06:55:52 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=trix@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201020_095605_551668_6A7D8273 X-CRM114-Status: GOOD ( 24.40 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, clang-built-linux , Greg KH , linux-iio@vger.kernel.org, nouveau@lists.freedesktop.org, storagedev@microchip.com, dri-devel , virtualization@lists.linux-foundation.org, keyrings@vger.kernel.org, linux-mtd@lists.infradead.org, ath10k@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, usb-storage@lists.one-eyed-alien.net, linux-watchdog@vger.kernel.org, devel@driverdev.osuosl.org, linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, linux-nvdimm , amd-gfx list , linux-acpi@vger.kernel.org, intel-wired-lan@lists.osuosl.org, industrypack-devel@lists.sourceforge.net, linux-pci@vger.kernel.org, spice-devel@lists.freedesktop.org, MPT-FusionLinux.pdl@broadcom.com, linux-media@vger.kernel.org, linux-serial@vger.kernel.org, linux-nfc@lists.01.org, linux-pm@vger.kernel.org, linux-can@vger.kernel.org, linux-block@vger.kernel.org, linux-gpio@vger.kernel.org, xen-devel@lists.xenproject.org, linux-amlogic@lists.infradead.org, openipmi-developer@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-integrity@vger.kernel.org, Linux ARM , linux-edac@vger.kernel.org, George Burgess , Network Development , linux-usb@vger.kernel.org, linux-wireless , LKML , linux-security-module@vger.kernel.org, "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , patches@opensource.cirrus.com, Joe Perches , bpf , ocfs2-devel@oss.oracle.com, linux-power@fi.rohmeurope.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org On 10/19/20 12:42 PM, Nick Desaulniers wrote: > On Sat, Oct 17, 2020 at 10:43 PM Greg KH wrote: >> On Sat, Oct 17, 2020 at 09:09:28AM -0700, trix@redhat.com wrote: >>> From: Tom Rix >>> >>> This is a upcoming change to clean up a new warning treewide. >>> I am wondering if the change could be one mega patch (see below) or >>> normal patch per file about 100 patches or somewhere half way by collecting >>> early acks. >> Please break it up into one-patch-per-subsystem, like normal, and get it >> merged that way. >> >> Sending us a patch, without even a diffstat to review, isn't going to >> get you very far... > Tom, > If you're able to automate this cleanup, I suggest checking in a > script that can be run on a directory. Then for each subsystem you > can say in your commit "I ran scripts/fix_whatever.py on this subdir." > Then others can help you drive the tree wide cleanup. Then we can > enable -Wunreachable-code-break either by default, or W=2 right now > might be a good idea. I should have waited for Joe Perches's fixer addition to checkpatch :) The easy fixes I did only cover about 1/2 of the problems. Remaining are mostly nested switches, which from a complexity standpoint is bad. > > Ah, George (gbiv@, cc'ed), did an analysis recently of > `-Wunreachable-code-loop-increment`, `-Wunreachable-code-break`, and > `-Wunreachable-code-return` for Android userspace. From the review: > ``` > Spoilers: of these, it seems useful to turn on > -Wunreachable-code-loop-increment and -Wunreachable-code-return by > default for Android In my simple add-a-cflag bot, i see there are about 250 issues for -Wunreachable-code-return. I'll see about doing this one next. > ... > While these conventions about always having break arguably became > obsolete when we enabled -Wfallthrough, my sample turned up zero > potential bugs caught by this warning, and we'd need to put a lot of > effort into getting a clean tree. So this warning doesn't seem to be > worth it. > ``` > Looks like there's an order of magnitude of `-Wunreachable-code-break` > than the other two. > > We probably should add all 3 to W=2 builds (wrapped in cc-option). > I've filed https://github.com/ClangBuiltLinux/linux/issues/1180 to > follow up on. Yes, i think think these should be added. Tom ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/