Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp862610img; Wed, 20 Mar 2019 12:27:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwP4Rz+vFI+mGYgvnAIJGv8qIFquFgVbhWbvek55ZL7wncw62Cf5Czu5l+hY5N+t2VbUxbW X-Received: by 2002:a17:902:1101:: with SMTP id d1mr9364530pla.19.1553110057162; Wed, 20 Mar 2019 12:27:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553110057; cv=none; d=google.com; s=arc-20160816; b=mb7kAYy0l6ErGe7ervDI/qnZlZL7Px33oPoOVFg6DEL5Sxkpmou7GugFPz65AC42hb Ky0RZU1O6p+voOFt99v1wQThXmF7kkez0MfA69E3mBKJDgmn8895SB3RiidLYfctggSy 9gN/9bnfRKx10L7XTKZfXEAfWmGQD3iXRPtnxI0hl3bIYmaI2nXaIQaDrINQviM5gSeQ Mix+xLiAbYPmfppH9XP24AHZgPoMCW+XEEOs+/7/Q7Of3u/SeNpQpn0uU54f3FhEq7E3 AEuHLm7bqkcS7UMPQE5EeH/PlWyR9igap3clNGEb6SRWCQp8LDQ9fM7pvdWuWGrk2gNX fg4w== 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=23AVsYxhzRdiKlJ5NzcN8GcPgQMVsP5b7QtMXAvvoes=; b=Q/jBLMKe5dfVc5vvvlqopEMyPbcPzFQmIwfRaBq88A++xjDq8OZ9tBXJieEhmwHzP7 TEHen095YCJaaJv2CMHaPFRIHj7Mq1/a12aJ/iA/1HMt3Yb2kyj6eUbZILXWp3NB62Jf huEjnuEskMeAs/mPQZWqjNfrI0a+JBdhPtYwep4xZ4czQj9hLOtrNdkn7Z3gc9SBIBFN j+QxastXDw1X6qffz0TLiw17Il3DXoF+dEI26BKbTCkftGnUZ7xcIa4+vDs8SsWpZmD/ bcEJsLrrj/4U51O3J6yHxZ6kaF2sd8xNuLLYybzAKAZWNCbL9ph4zQKA3zWaVZ1g7Pob pCJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ogZ3DGvQ; 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 k7si2360858plt.198.2019.03.20.12.27.21; Wed, 20 Mar 2019 12:27:37 -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=ogZ3DGvQ; 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 S1726686AbfCTTY5 (ORCPT + 99 others); Wed, 20 Mar 2019 15:24:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:52190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726023AbfCTTY5 (ORCPT ); Wed, 20 Mar 2019 15:24:57 -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 B196D21841; Wed, 20 Mar 2019 19:24:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553109896; bh=J/tyPdWp5ij+HzyxPMKplKC0JtfFbMNLhYxrJRSFnpY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ogZ3DGvQpv2k6ADYAy3sobBQuPA7xXyxp2IR4AQ3FbPlVlh4EBXkapSsHvDiqd6bd k6Jg6aaGaUAAckERGj/2SovqAsg6TukCEDi07EJEAsOgyZ/U7uUPCGPCQYWcuwbyJ5 olZHouW1t93osddh2Qwe2hw/fJyyhsExrfQuyNyg= Date: Wed, 20 Mar 2019 14:24:54 -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: <20190320192454.GB251185@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. Does this fix all the remaining cases in drivers/pci? I'd like to fix them all at once. What's the best way to watch for new warnings being added? I fiddled with "make W=2" etc but it didn't seem useful. Does the 0-day robot warn when -Wimplicit-fallthrough warnings are added? Bjorn > 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 >