From patchwork Wed Jan 27 14:04:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101071 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2603018lbb; Wed, 27 Jan 2016 06:08:01 -0800 (PST) X-Received: by 10.98.93.131 with SMTP id n3mr42639929pfj.9.1453903681422; Wed, 27 Jan 2016 06:08:01 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k67si9759582pfb.171.2016.01.27.06.08.01; Wed, 27 Jan 2016 06:08:01 -0800 (PST) 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 S932974AbcA0OH6 (ORCPT + 30 others); Wed, 27 Jan 2016 09:07:58 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:62853 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932493AbcA0OHv (ORCPT ); Wed, 27 Jan 2016 09:07:51 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue002) with ESMTPA (Nemesis) id 0LjiA5-1ZnA3q0GU5-00boEU; Wed, 27 Jan 2016 15:07:19 +0100 From: Arnd Bergmann To: "David S. Miller" Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , netdev@vger.kernel.org, Jon Mason , linux-kernel@vger.kernel.org Subject: [PATCH 6/9] net: vxge: avoid unused function warnings Date: Wed, 27 Jan 2016 15:04:56 +0100 Message-Id: <1453903507-3427225-7-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453903507-3427225-1-git-send-email-arnd@arndb.de> References: <1453903507-3427225-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:Nlg/1tNSnzmCfDTs0J0PBzcsbTRb8x7R4gnlyXUPZhWvKgAg8FR yK43/rzXUIUTHN2MoVQEMKrXJhycWMjb8zgJ+zorWdBYZ+VLTVtO2lmuiQpfeVwffNKGuym 0UqgiMlLmZvMR4OESj5vT7wNXeSNCEWOzQzypWh4dLQrFq+8mhnoFvUTtfq5kR9X3UZ1A/P mlwaGGM+mHkyiPQZ8ymXQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:Fbin2IAb0SM=:LZlUFAvSIplmxAuEeDHoma SIEmx/nhJCmU0YmgJLlAd2WWB+kww5sygopsaSd/93NxE2zZvMBloMspikuG0g4oOcMALXGCL k0Qoe2rUfJj7uR4HFHnA9CR3+Mbjwol7Xy3uJlQaxYrvFtRR+0SrAC71ByV6wS9SeWvaY4MuO /vCbWRJ1Nyd6csRaucGE/M0hEwUnEoUjNj6VSvNeU9qt9W8BMkIhHJZ5uX04F7uC4hf51aSS/ miGSFGNtRevCFVCTYg97LxHEAP3Ahn51eF6p/uBuPMaHtOFSb/+azl/amD5AnZEDUZfV5ebWs 7V5j6Pg4RKnAElm3Jg/gICclnDwGj97ps36mHTbLeEaGqoXJYi7qD8BWmAswp/cB0yaHe4ZWH DCPJjLHPuyXjrbmV22sTi17Que1kGbIByDJEm7V7TXCcqovltpoJP3aNVe+kRsO9S1LufjZjq 0j9nvlO03iMAqrC/KKN2F2eWbSVTfIsr9mvA494x9Yr1Ih6WLMBIvhBRjGGn0KvepVrQonPZ5 QDtVrKyix8LZIOopBQG/ntfOqqQcq5a+U+kf5QxgKIYXUJTjnkZCzvfgzPBgbkFOoanV8wkq5 3CgeBJBqduZ8chtfSXz7P8FBJlcqmTZ4Umj04StSJh5y5ACOkMk/8AlD0LZvAwcoavck7E9mP 3AHOAtdTn0JnDWmL05bUu8gLQ01OujP+UNxpQvGNAeRBT7KEqvwNQ2osUxfAa3NYi4ws= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When CONFIG_PCI_MSI is disabled, we get warnings about unused functions in the vxge driver: drivers/net/ethernet/neterion/vxge/vxge-main.c:2121:13: warning: 'adaptive_coalesce_tx_interrupts' defined but not used [-Wunused-function] drivers/net/ethernet/neterion/vxge/vxge-main.c:2149:13: warning: 'adaptive_coalesce_rx_interrupts' defined but not used [-Wunused-function] We could add another #ifdef here, but it's nicer to avoid those warnings for good by converting the existing #ifdef to if(IS_ENABLED()), which has the same effect but provides better compile-time coverage in general, and lets the compiler understand better when the function is intentionally unused. Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/neterion/vxge/vxge-main.c | 31 ++++++++++---------------- 1 file changed, 12 insertions(+), 19 deletions(-) -- 2.7.0 diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.c b/drivers/net/ethernet/neterion/vxge/vxge-main.c index 50d5604833ed..e0993eba5df3 100644 --- a/drivers/net/ethernet/neterion/vxge/vxge-main.c +++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c @@ -2223,8 +2223,6 @@ static irqreturn_t vxge_isr_napi(int irq, void *dev_id) return IRQ_NONE; } -#ifdef CONFIG_PCI_MSI - static irqreturn_t vxge_tx_msix_handle(int irq, void *dev_id) { struct vxge_fifo *fifo = (struct vxge_fifo *)dev_id; @@ -2442,16 +2440,13 @@ static void vxge_rem_msix_isr(struct vxgedev *vdev) if (vdev->config.intr_type == MSI_X) pci_disable_msix(vdev->pdev); } -#endif static void vxge_rem_isr(struct vxgedev *vdev) { -#ifdef CONFIG_PCI_MSI - if (vdev->config.intr_type == MSI_X) { + if (IS_ENABLED(CONFIG_PCI_MSI) && + vdev->config.intr_type == MSI_X) { vxge_rem_msix_isr(vdev); - } else -#endif - if (vdev->config.intr_type == INTA) { + } else if (vdev->config.intr_type == INTA) { synchronize_irq(vdev->pdev->irq); free_irq(vdev->pdev->irq, vdev); } @@ -2460,11 +2455,10 @@ static void vxge_rem_isr(struct vxgedev *vdev) static int vxge_add_isr(struct vxgedev *vdev) { int ret = 0; -#ifdef CONFIG_PCI_MSI int vp_idx = 0, intr_idx = 0, intr_cnt = 0, msix_idx = 0, irq_req = 0; int pci_fun = PCI_FUNC(vdev->pdev->devfn); - if (vdev->config.intr_type == MSI_X) + if (IS_ENABLED(CONFIG_PCI_MSI) && vdev->config.intr_type == MSI_X) ret = vxge_enable_msix(vdev); if (ret) { @@ -2475,7 +2469,7 @@ static int vxge_add_isr(struct vxgedev *vdev) vdev->config.intr_type = INTA; } - if (vdev->config.intr_type == MSI_X) { + if (IS_ENABLED(CONFIG_PCI_MSI) && vdev->config.intr_type == MSI_X) { for (intr_idx = 0; intr_idx < (vdev->no_of_vpath * VXGE_HW_VPATH_MSIX_ACTIVE); intr_idx++) { @@ -2576,9 +2570,8 @@ static int vxge_add_isr(struct vxgedev *vdev) vdev->vxge_entries[intr_cnt].in_use = 1; vdev->vxge_entries[intr_cnt].arg = &vdev->vpaths[0]; } -INTA_MODE: -#endif +INTA_MODE: if (vdev->config.intr_type == INTA) { snprintf(vdev->desc[0], VXGE_INTR_STRLEN, "%s:vxge:INTA", vdev->ndev->name); @@ -3889,12 +3882,12 @@ static void vxge_device_config_init(struct vxge_hw_device_config *device_config, if (max_mac_vpath > VXGE_MAX_MAC_ADDR_COUNT) max_mac_vpath = VXGE_MAX_MAC_ADDR_COUNT; -#ifndef CONFIG_PCI_MSI - vxge_debug_init(VXGE_ERR, - "%s: This Kernel does not support " - "MSI-X. Defaulting to INTA", VXGE_DRIVER_NAME); - *intr_type = INTA; -#endif + if (!IS_ENABLED(CONFIG_PCI_MSI)) { + vxge_debug_init(VXGE_ERR, + "%s: This Kernel does not support " + "MSI-X. Defaulting to INTA", VXGE_DRIVER_NAME); + *intr_type = INTA; + } /* Configure whether MSI-X or IRQL. */ switch (*intr_type) {