Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2166665pxu; Sat, 17 Oct 2020 14:09:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyztO08SyjiNL0Q02klyWI1nJLv/mdS1RInf+zIBetM6d3leV4BY66s9o3Ev0UD5WmI+oO9 X-Received: by 2002:aa7:df0c:: with SMTP id c12mr11010608edy.234.1602968979000; Sat, 17 Oct 2020 14:09:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602968978; cv=none; d=google.com; s=arc-20160816; b=wCqN+dzfVccwHJznfH0lnJpYs5ZP79dJSqAWiNdMoQeYCkMOZFXjh2AxO4nTNKqDJB pt/7N/8Jq6/O1Vc96EKsbDBlbEXyWHLOuLHbTOipBLrTRL1vpjPi9fs2YYSkrnynjdGh iWjZbNctKUoGyPQm3vYpWwyjfGFm+Gb55s/GZC7Fy0Qz2SGgZq2CccUB8uKHbGgsXOEv loC6kILPvwbnKEeGxD7HeEkBbsd/5IREOk+13lRqM7psuQz/9koDTfEWXRk6dA46rwGL q4YmmTXFCn6FXSNA5ROuIXL7BHxCz7ey/Wv4WkYj4qA8o7st1hDrsAxpJkOA56+YrovG WsUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=QU5tUnKrk3cCgEOM6DUuSpHohPcIoidzngrqxPrVqlg=; b=d+MVMTgEtFBzgmcCWRRlGkM2ZfgVEUBE0bG5kSaxrL/569E+hnL40OoEw+1LRCivaj 60E1Ptj5p/R9Syc4bKyySP6bIb2gLMak73jnKI3Sr7oMO0zoxyACiTab1BedlAFd0GUF CQ0yQFEwDvCF5SDNPydT2aYxOCSENsA5enA2BoIRNc49mM6A3IeiZuc0Uv8ssS9z0aw0 9oZ4nwq6kA5J7Eqt8czTmFYfG4g8gn40umOoQGt/ZPMeLEGARYUfavZchXD6QV+u6Fn7 2E0IRg7dsQPxA4hRwQrh6Sk8Hlyg3s3pa/g54nIuY9PLqHN0/YiSJ+R9AxLEmNOsUI4x Rotg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=ntIAxdfj; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu21si4712796edb.86.2020.10.17.14.08.58; Sat, 17 Oct 2020 14:09:38 -0700 (PDT) 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=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=ntIAxdfj; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439172AbgJQVBe (ORCPT + 99 others); Sat, 17 Oct 2020 17:01:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439166AbgJQVBe (ORCPT ); Sat, 17 Oct 2020 17:01:34 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA060C0613D5 for ; Sat, 17 Oct 2020 14:01:33 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id dt13so8420727ejb.12 for ; Sat, 17 Oct 2020 14:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QU5tUnKrk3cCgEOM6DUuSpHohPcIoidzngrqxPrVqlg=; b=ntIAxdfj5B3UZZJPAO3W3zqpuYJdxZe6wmMN+Cg5+tfh5QjsxLbXR5o2amfdJQ2J48 +r9G2vZiMs4S/e6t6kNU+/1RisTXP2Yspklt8lksB4PhSQjsUISEYusYJeN2p0XCHoqr 5tX/QI+fZe3GQZJaviemAIYQlGxoIFC7s6aX8R5MJQLi2SOYJ/keQbrc62HNUeJ8pCOI 7WYztP0OE4axPIRoGDfVK4aq4k9dPY6fZ69Y4fL3/a70qb0GrKtNhloBSbp9yIhwtpgg UECkhdkcAFyI2jUc3qFZfU7NKoc+E1dZJHZxhONiRQFFV//aVnbaYjp+hfJUaNjfh3TU ik3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QU5tUnKrk3cCgEOM6DUuSpHohPcIoidzngrqxPrVqlg=; b=fH52WQDLJwwH+ktC48DbjPnpQk9LpvIRM3TDt5E8wO5D196IVC7R/nyB0rcL+9ZEc6 VRa+3FrgYxqEyU41iIYj+9q0jD499av3QMzGcHg0jUAGgvEDeiEyQtmOSLnSjzBQqv7E G7qSjzW5CpDNqRXZKHRP2Zz4RfTSnC9h52UxjktlqeHGn8kQRK1rzk0Z6F2OWmMb8NRi SWZsrvcWq1PQ9qoimnZ7SQO0QMWiE2V0Yg9BInkOptcNJ2QU1u+RbkHMlkVS5AYR9kuY g/ijd76Pid/8m+flnO2jb+Z9CYk7/+cNdJoVx1F+FRIMOTV0Ia2TsRB8PinFflTaZsij /rSw== X-Gm-Message-State: AOAM530W8BNm/ujr7QTRahA9dZjLGYd8T/7kybm/TTdQpUZ2q1OrvrRK HC9Gmg17QbQnxZ0cNy4VjsCFjwdEtay4xGLcXPPLNQ== X-Received: by 2002:a17:906:1a19:: with SMTP id i25mr9957370ejf.323.1602968492144; Sat, 17 Oct 2020 14:01:32 -0700 (PDT) MIME-Version: 1.0 References: <20201017160928.12698-1-trix@redhat.com> In-Reply-To: <20201017160928.12698-1-trix@redhat.com> From: Dan Williams Date: Sat, 17 Oct 2020 14:01:22 -0700 Message-ID: Subject: Re: [RFC] treewide: cleanup unreachable breaks To: trix@redhat.com Cc: Linux Kernel Mailing List , linux-edac@vger.kernel.org, Linux ACPI , Linux-pm mailing list , xen-devel , linux-block@vger.kernel.org, openipmi-developer@lists.sourceforge.net, linux-crypto , Linux ARM , linux-power@fi.rohmeurope.com, linux-gpio@vger.kernel.org, amd-gfx list , Maling list - DRI developers , nouveau@lists.freedesktop.org, virtualization@lists.linux-foundation.org, spice-devel@lists.freedesktop.org, linux-iio@vger.kernel.org, linux-amlogic@lists.infradead.org, industrypack-devel@lists.sourceforge.net, "Linux-media@vger.kernel.org" , MPT-FusionLinux.pdl@broadcom.com, linux-scsi , linux-mtd@lists.infradead.org, linux-can@vger.kernel.org, Netdev , intel-wired-lan@lists.osuosl.org, ath10k@lists.infradead.org, Linux Wireless List , linux-stm32@st-md-mailman.stormreply.com, linux-nfc@lists.01.org, linux-nvdimm , Linux PCI , linux-samsung-soc , platform-driver-x86@vger.kernel.org, patches@opensource.cirrus.com, storagedev@microchip.com, devel@driverdev.osuosl.org, linux-serial@vger.kernel.org, USB list , usb-storage@lists.one-eyed-alien.net, linux-watchdog@vger.kernel.org, ocfs2-devel@oss.oracle.com, bpf@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, "open list:KEYS-TRUSTED" , alsa-devel@alsa-project.org, clang-built-linux Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Sat, Oct 17, 2020 at 9:10 AM 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. > > clang has a number of useful, new warnings see > https://clang.llvm.org/docs/DiagnosticsReference.html > > This change cleans up -Wunreachable-code-break > https://clang.llvm.org/docs/DiagnosticsReference.html#wunreachable-code-break > for 266 of 485 warnings in this week's linux-next, allyesconfig on x86_64. > > The method of fixing was to look for warnings where the preceding statement > was a simple statement and by inspection made the subsequent break unneeded. > In order of frequency these look like > > return and break > > switch (c->x86_vendor) { > case X86_VENDOR_INTEL: > intel_p5_mcheck_init(c); > return 1; > - break; > > goto and break > > default: > operation = 0; /* make gcc happy */ > goto fail_response; > - break; > > break and break > case COLOR_SPACE_SRGB: > /* by pass */ > REG_SET(OUTPUT_CSC_CONTROL, 0, > OUTPUT_CSC_GRPH_MODE, 0); > break; > - break; > > The exception to the simple statement, is a switch case with a block > and the end of block is a return > > struct obj_buffer *buff = r->ptr; > return scnprintf(str, PRIV_STR_SIZE, > "size=%u\naddr=0x%X\n", buff->size, > buff->addr); > } > - break; > > Not considered obvious and excluded, breaks after > multi level switches > complicated if-else if-else blocks > panic() or similar calls > > And there is an odd addition of a 'fallthrough' in drivers/tty/nozomi.c [..] > diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c > index 5a7c80053c62..2f250874b1a4 100644 > --- a/drivers/nvdimm/claim.c > +++ b/drivers/nvdimm/claim.c > @@ -200,11 +200,10 @@ ssize_t nd_namespace_store(struct device *dev, > } > break; > default: > len = -EBUSY; > goto out_attach; > - break; > } Acked-by: Dan Williams