Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp26791img; Wed, 20 Mar 2019 13:15:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqygyiYa9/XPbSr0sdBm7qevEIXMnzZIj+oi5EzsvfMnDGv6G5sM/TWDCA7kCcWpz2jbuDBS X-Received: by 2002:a17:902:8ecb:: with SMTP id x11mr9790935plo.40.1553112907992; Wed, 20 Mar 2019 13:15:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553112907; cv=none; d=google.com; s=arc-20160816; b=UdTK9txposjPNITjoA3me1+n/+MWMj9Y/JwL5lvVfet/Mh7NGtWij5Gam0+kkt0lKX J2+nDgTfFm+DQw1RAmXsgLsZFU8HUwl/VCLsPRVSDL3dsgahk+HElbRL+k7kQsAPYEZ+ eROzPm5lhGMBYAorsV+movZG3CfPHk6UeQCIyXnq9EkOjljbGNDkggEL+86dt2nUYw1Y Z1UEQO55GyZIO+6qW0Wuuot2NqcI09mlbZedzXJmOfGSCFZov7hG0Cbeyh2vE4cmIH/n 9VrTDIu2Gi19WqSXC7Hbsx3iekxxi/i8AzkYU5OIFuBLLnCNsvHxX2qqcYVm0Tq0EU09 It7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=V9uamcN8pTEdjPQB/11FH9eP/XJU0iczEOIR6kgtStg=; b=Cd1pkLAbty4dtBV+FopHgypWy/fjvymOobaAbzjOdcjQ54v29iIGOy9LuEYoL1/uEd B7FK0bU87YEC1eCWHwALMscN53aC85vLmpp5XQnv5LL2Z07Cj4W8ApHnVf5b52suit08 pF046WGc3sn5go6uF6jtgITPUPNW2loVyVpSNxo9I4DVIhKsVXmsj1UauSoTxBpYzVXR Cj+vEQC5m12NXg89CJ+keUpYmthjqRu+KEcOHONoTjcYi1bb3v/okkCAaJ7umK9AVN03 Qkj3ptVFf7hwvLJSv3c82biRgz9dUbamUlVZz+lPgW3eTypfbTAbanJ3uAJ7xEO/HUUA ifbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=118iATCX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h11si2501511pls.237.2019.03.20.13.14.26; Wed, 20 Mar 2019 13:15:07 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=118iATCX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726835AbfCTUNi (ORCPT + 99 others); Wed, 20 Mar 2019 16:13:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:41602 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726023AbfCTUNi (ORCPT ); Wed, 20 Mar 2019 16:13:38 -0400 Received: from localhost (unknown [69.71.4.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F21A121873; Wed, 20 Mar 2019 20:13:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553112817; bh=xNs9p+gqBF+VlURRJefF5+eyyEkxabgfa2EPw5Xm46I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=118iATCXJsVyKQEeC3k1HVveVYGQ0wB1lH2yGGSZG6iJU+gOoe6vw5f/Ov50CdtQx 2b33kda+fFbwSznjyHSN9VfvFa2gXOBs4Ox56Oktk121l7udwojZ8jVqA/Q3Z/AkvF DnglwVDVWJxFpkzfddiEHUPV1rHz2OlY77msbyBI= Date: Wed, 20 Mar 2019 15:13:35 -0500 From: Bjorn Helgaas To: "Gustavo A. R. Silva" Cc: Boris Ostrovsky , Juergen Gross , Stefano Stabellini , Konrad Rzeszutek Wilk , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, Kees Cook Subject: Re: [PATCH] PCI: Mark expected switch fall-throughs Message-ID: <20190320201335.GD251185@google.com> References: <20190320182715.GA9406@embeddedor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190320182715.GA9406@embeddedor> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 20, 2019 at 01:27:15PM -0500, Gustavo A. R. Silva wrote: > In preparation to enabling -Wimplicit-fallthrough, mark switch > cases where we are expecting to fall through. > > This patch fixes the following warnings: > > drivers/pci/proc.c: In function ‘proc_bus_pci_ioctl’: > drivers/pci/proc.c:216:6: warning: this statement may fall through [-Wimplicit-fallthrough=] > if (arch_can_pci_mmap_wc()) { > ^ > drivers/pci/proc.c:225:2: note: here > default: > ^~~~~~~ > > drivers/pci/xen-pcifront.c: In function ‘pcifront_backend_changed’: > drivers/pci/xen-pcifront.c:1105:6: warning: this statement may fall through [-Wimplicit-fallthrough=] > if (xdev->state == XenbusStateClosed) > ^ > drivers/pci/xen-pcifront.c:1108:2: note: here > case XenbusStateClosing: > ^~~~ > > Notice that, in this particular case, the /* fall through */ > comment is placed at the very bottom of the case statement, > which is what GCC is expecting to find. > > Warning level 3 was used: -Wimplicit-fallthrough=3 > > This patch is part of the ongoing efforts to enable > -Wimplicit-fallthrough. > > Signed-off-by: Gustavo A. R. Silva Applied to pci/misc for v5.2, thanks! > --- > drivers/pci/proc.c | 1 + > drivers/pci/xen-pcifront.c | 2 +- > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c > index 6fa1627ce08d..445b51db75b0 100644 > --- a/drivers/pci/proc.c > +++ b/drivers/pci/proc.c > @@ -222,6 +222,7 @@ static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd, > } > /* If arch decided it can't, fall through... */ > #endif /* HAVE_PCI_MMAP */ > + /* fall through */ > default: > ret = -EINVAL; > break; > diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c > index eba6e33147a2..14cf0f41ecf0 100644 > --- a/drivers/pci/xen-pcifront.c > +++ b/drivers/pci/xen-pcifront.c > @@ -1104,7 +1104,7 @@ static void __ref pcifront_backend_changed(struct xenbus_device *xdev, > case XenbusStateClosed: > if (xdev->state == XenbusStateClosed) > break; > - /* Missed the backend's CLOSING state -- fallthrough */ > + /* fall through - Missed the backend's CLOSING state. */ > case XenbusStateClosing: > dev_warn(&xdev->dev, "backend going away!\n"); > pcifront_try_disconnect(pdev); > -- > 2.21.0 >