From patchwork Tue Jul 24 09:39:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10541741 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8564C112B for ; Tue, 24 Jul 2018 09:39:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F557286DB for ; Tue, 24 Jul 2018 09:39:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 63444286DF; Tue, 24 Jul 2018 09:39:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 12A67286DC for ; Tue, 24 Jul 2018 09:39:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388236AbeGXKpR (ORCPT ); Tue, 24 Jul 2018 06:45:17 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:40801 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388223AbeGXKpR (ORCPT ); Tue, 24 Jul 2018 06:45:17 -0400 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0Ma2zH-1fR4870eqN-00Loxu; Tue, 24 Jul 2018 11:39:28 +0200 From: Arnd Bergmann To: Bjorn Helgaas Cc: Alex Williamson , James Puthukattukaran , Arnd Bergmann , Mika Westerberg , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] PCI: fix unused variable warning Date: Tue, 24 Jul 2018 11:39:03 +0200 Message-Id: <20180724093924.1752416-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:USQGrNY0FLcQHMFs8WFsx4d0jCn3RIOVCCoNW2NBfRr9ho1zjB9 1/KYFRhQcfp6uTkSFpNU1z70YoM4fXUU7Fn8I6p04JXpW2VMQSsJEBbmhhvXXcDZTGSTr/M uyaPvMwXQNkGwwuMmHAGJvcAGcGhjMSo5+2g5XB1ueF5yM1aKoOVlqQzG8SjYLs5yDsuvpa laHQ9iqVtQyZ7vs6dpEGw== X-UI-Out-Filterresults: notjunk:1;V01:K0:lLNtJO+WDYE=:jtlbfSvdDp4B4mLUnfpQ18 f3i5pg+kE1Z/anqcrBE52LtuRt3Cxy3sgIdTfRdmZpSKIH1YY+R954+jDfGs/mtZ1erKNIXB+ XMPz2ThicN+6V4fvoNoYbx2/2NT/ilHf+q10tP4HLL3C4Go438Olucmba6OXhvdmPry56Vzz7 LA54pWHcs42VfHElW4oeMajuhigtcqebCoeAzg9uGfVYLW7RXpE1aBoIjAhLlSdOPt5nRxYJs 2z7iZsOnie8ZdaXdN/hxNYQH5gXgmsdQecIZT4GJbU03s3gMnuPAuwhgeCPrGqeXX9nEXrs7q EHS0TLUtbCKCPo+qqFK+oyILrNkqyU5AIFoVcKEcvrFpjqRxQ+Q3z9H/4dQjJUW66MS+Qj8zj aDnhKcmd5Vfz9EmSHidI7+39v4osvkkCh9oPEOjl8d1zi00+g4sFScAIVhy3uoI4oskdSStmM 2Xp6yZIAFrVEWKQsFUqSXxCzkp8ejmNNkwW+5rfhLSDiEoMo6UjI5nQzJ1EPvQKYb1HLm34Ao Fo45d1F/5SI16BH0ZBmkuZK1gqIpiGnxvt9L8vUnEpjFoiCIgsOR/0sU49ExJtnDeX1PdeFjI 0qEHVQCBjnC383wfd8Gyd30jnLrfFhYmL3v25BaifrMUkh8QCFuMGvgBXQhfsItQbejdS2k7Q YoSkvHsi144/n3oyrMb/4gHJRDgKIqzFpshdiGWQ6Q5URjFt+exSBhAe67T21B/oF1cQ= Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The newly introduced function produces a warning without CONFIG_PCI_QUIRKS: drivers/pci/probe.c: In function 'pci_bus_read_dev_vendor_id': drivers/pci/probe.c:2221:18: error: unused variable 'bridge' [-Werror=unused-variable] Move the variable declaration into that #ifdef to avoid the warning. Fixes: ac5ea104a279 ("PCI: Workaround IDT switch ACS Source Validation erratum") Signed-off-by: Arnd Bergmann --- drivers/pci/probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 1c581346c5b9..7a5323798312 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2218,9 +2218,9 @@ bool pci_bus_generic_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *l, bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *l, int timeout) { +#ifdef CONFIG_PCI_QUIRKS struct pci_dev *bridge = bus->self; -#ifdef CONFIG_PCI_QUIRKS /* * Certain IDT switches have an issue where they improperly trigger * ACS Source Validation errors on completions for config reads.