Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp816424img; Wed, 20 Mar 2019 11:28:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwp/AYbTAJ2btQJ6V/Cy9QlTLBo2mDNkc2w1DCCsuyiNVbBXcRpT/vLNj0js84Wu+Kb6qBS X-Received: by 2002:a62:1d8c:: with SMTP id d134mr9411427pfd.185.1553106511004; Wed, 20 Mar 2019 11:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553106510; cv=none; d=google.com; s=arc-20160816; b=c5LatlO4b6KTCCw5EfxaiAyZ9KtpFHXYG/d8TM5UmYagn5OPzKAkJduzEsVRCevJ7A 3K+woEIfIfHnEoiHeLG+L+jFahFORwNRs3NijPCQBNmIT4jlIBwuP/70XQaSwDLnXJKU qm/pjftACBIniW1ly259XP3kEq7AnCnWKg+a19TH0lkL+lW8uGXo5/B/LMFp1qL7u5bW /lKHmAzCnJSx7CGBVN4YTpbKMWHKunkuv87Zg6FuPV2hMSfCX1gqe54rSroyBobksOwi xeqFrUfYca9lCbVtbhAcwYUtwzyDJRcvyM/HCR1grNpWlpj7zJDOHrh3/hskjPD2SMJS X6rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date; bh=gvPM7l83WUJKgQF+FYz1a6X8j8PbmZ84b/vLMg8Yag4=; b=fGjwQpe2GlRXIXM5hEzNU6iPrAmiH24zPjIfvh5BFWuTRqcz91dcVU5CzvkKUv1yOJ EjBcaJIzrbPKc2VcVrEVNQEWp2QaUTAFwDwkDWxpxYVS5WbQNOm3s6/eWGM+LoWnIDWf /WKnIDacYOww1VZqLilm/jzIUoxx2Og3gjhgBd2BISnVAhi9w6Mu7DQVcwbKCHYCer+N TtUxF3yLcR8LogdBoNavDm2JiWrYYMtbr0D0nXyW7DEop+pR5mL89JQmxLDpn/TwTIM9 C0r86JOEIVj+wn7PlleazfrKeclzpa/IE1gQFYyMME/xllotsfNypGJHW3Sb11EGudhG 9FuA== 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 u22si2377921plq.145.2019.03.20.11.28.15; Wed, 20 Mar 2019 11:28:30 -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; 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 S1727404AbfCTS1i (ORCPT + 99 others); Wed, 20 Mar 2019 14:27:38 -0400 Received: from gateway32.websitewelcome.com ([192.185.145.119]:17484 "EHLO gateway32.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726438AbfCTS1i (ORCPT ); Wed, 20 Mar 2019 14:27:38 -0400 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway32.websitewelcome.com (Postfix) with ESMTP id B8D4911A92E2 for ; Wed, 20 Mar 2019 13:27:36 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id 6fw8hrpZi4FKp6fw8h5V19; Wed, 20 Mar 2019 13:27:36 -0500 X-Authority-Reason: nr=8 Received: from [189.250.104.39] (port=59010 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.91) (envelope-from ) id 1h6fvo-002lYt-Gh; Wed, 20 Mar 2019 13:27:35 -0500 Date: Wed, 20 Mar 2019 13:27:15 -0500 From: "Gustavo A. R. Silva" To: Bjorn Helgaas , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , Konrad Rzeszutek Wilk Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, "Gustavo A. R. Silva" , Kees Cook Subject: [PATCH] PCI: Mark expected switch fall-throughs Message-ID: <20190320182715.GA9406@embeddedor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.9.4 (2018-02-28) 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: 189.250.104.39 X-Source-L: No X-Exim-ID: 1h6fvo-002lYt-Gh X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [189.250.104.39]:59010 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 12 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 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 --- 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