From patchwork Mon Dec 18 13:45:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 122217 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2853025qgn; Mon, 18 Dec 2017 05:46:18 -0800 (PST) X-Google-Smtp-Source: ACJfBoumgnVvboECg6rfB0Sqpi4Ob/WegsJR/uOUJOLnN/4RlgJKYjNjQJ+8b/dJG2V27d7PdduK X-Received: by 10.99.111.8 with SMTP id k8mr16758680pgc.74.1513604778443; Mon, 18 Dec 2017 05:46:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513604778; cv=none; d=google.com; s=arc-20160816; b=o9FdSJDsMzGptgzZI+bUhtDQ3c6zg3Qt+SF193xVsWgFg6vcEbwSHiiPtvdj5PcAii pG6iMhbvfrTqe/yh9Bk1bod+u/+lSJ/0N74rZMbysbPlf7aymK+0kj5/xbKjHZ1P5PDp BLiQXl11KJKUp/X6CnXW4T42fDo9Cc1cboByn7n+S1Ig28vZvrMIJviSUli95kvrzd0u HzCYMZZbz260HyapEkH6nZFV99yUhxG7aVRr+Y1EGLIV8fvqtCERfsTeLMATeN6pKybv VsRwWjnU4nBefXeeOnNDv0OGRJfB0TvBAkvTtMe5G+nyy602HVRnULTCT5Ti1c6C9H20 RKaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=1yGmPe0GvbKochagpJhKC+OwxLQw4JLFL66AosAoe08=; b=1Fi23ipXYw30ONcjyXnrlF7OeNIkzpntowqswDHSsN8KpnxB2+bBrc1IavDnw3P3Cc uhpavWEvj3GSttfH8I+0eFHx1c6iDZBe79bPk0Bx1P49m7CYDMwB5vxOPqvvK36Dt1qi yQPk9MCd/ZfTQ9JMqHkyYSi5bPq/mM0Gzk3G2UG9K7FocDPlgP9DgCkS0GVTfGFq4tW3 KuFTSXRKorBTBTxjTtb/AzC/FORKPMFcz80Hyuzrv0Pp40HttUxxnibGL13vB3/K2Ojl 3PRvYII8eQDTdGRhNye3kB3D9c7Sa0jhj3BDaZEaOHJVYo2xFfBF1KSANB7T/riGUi++ oyfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-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 b14si9425714pll.425.2017.12.18.05.46.18; Mon, 18 Dec 2017 05:46:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of netdev-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 netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758714AbdLRNqQ (ORCPT + 7 others); Mon, 18 Dec 2017 08:46:16 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:64176 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752773AbdLRNqN (ORCPT ); Mon, 18 Dec 2017 08:46:13 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0MT8yM-1eY2VX1A5G-00S9VH; Mon, 18 Dec 2017 14:46:05 +0100 From: Arnd Bergmann To: Maya Erez , Kalle Valo Cc: Arnd Bergmann , Lazar Alexei , Dedy Lansky , Hamad Kadmany , Lior David , Gidon Studinski , linux-wireless@vger.kernel.org, wil6210@qca.qualcomm.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] wil6210: fix build warnings without CONFIG_PM Date: Mon, 18 Dec 2017 14:45:51 +0100 Message-Id: <20171218134604.3087909-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:nooQG08wfCFie1gZnGVWlWeMrrW5YPWSTkqYZAkhX4YD0rdebzU V4EM++zJr40RXBUYJKM4POP4mYT8zT8U01ygaNlnz/rO9OY/ogTgZyxf+cVY1YYa3/2tfEF 3PtQH+UNrNHoqtOWOUFX9+CQWnhmIe3VnZUavt7CheoveZC8wbbcuz9odAT7SB46I0cLQcc BOfgHBBzTwDrnbxUFdZuA== X-UI-Out-Filterresults: notjunk:1; V01:K0:4Dy583vl494=:qKdikxmDMFkz3Lj89m5KUk Sfmfl6tJLrkphAgbBmu3Poea7YcDohRbeDY0ltVAPqKXa3fTDIzbhuxuF4roTxk1QfPv0vgb/ KEkwaVR/qqmuhDLSfzCs5/gjVenHKKHxe2cI2Dgq1lVU4iVirdGz0jvZc/HiRmFeLg+kcnkNz XVMBmpep50KWuBETpP/y9KiF57arvsZDxdfVtyRlq/K2SaNPxg8s3FCNXEREVDzrsRoRHClld esLSu0pYeq669OrQrePw1ecINEcDccik31D5QwYacEhJCIEDUFBWo0PcFhu7FavJGsqhrKqSR 72Mo/v8ens252MZk/99xxnbmeYXzKWzcagsQhabs2/9hp2LvnVuhQQxA+d4XcZKTgLbBtPrF1 bj7Opvzee5TdV3SRR5KhRMtmYdnEwn+iTTNrxfaJZIOdjJL0V64dLs/jTLvK3UmxhEf+FGCcV VI3CzXRwROzJA2bI76KmVaYiDbtnFvvrWBtnlzg0tiGF7BDy45bhlyRVEtCl68Jd+wGxveq5e 9bBfMZmFIM2chDUdEwps59gCxvizMHTNTbSvQt4jFW2e775AeTtADLkclS4jlrFDSiHQ/h+Y7 gzRrKN8RVOMeyBMEL9ozKRcsljCggNOroF1fzgXuAlR3GlNi9WpViUswURtMD7d7OPcEF7F6d +R/ew7qr+53mKB/Ch5hpQHFaZQ3MPCO4KG3Gyhefqs6AAvyY/Yh0zVHCBbW0DLpDXBQHXZTBJ IZU0/xyWHq6Eg7A5z1vmSCpASRKp97ssADG1DA== Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The #ifdef checks are hard to get right, in this case some functions should have been left inside a CONFIG_PM_SLEEP check as seen by this message: drivers/net/wireless/ath/wil6210/pcie_bus.c:489:12: error: 'wil6210_pm_resume' defined but not used [-Werror=unused-function] drivers/net/wireless/ath/wil6210/pcie_bus.c:484:12: error: 'wil6210_pm_suspend' defined but not used [-Werror=unused-function] Using an __maybe_unused is easier here, so I'm replacing all the other #ifdef in this file as well for consistency. Fixes: 94162666cd51 ("wil6210: run-time PM when interface down") Signed-off-by: Arnd Bergmann --- drivers/net/wireless/ath/wil6210/pcie_bus.c | 25 ++++++++----------------- drivers/net/wireless/ath/wil6210/wil6210.h | 2 -- 2 files changed, 8 insertions(+), 19 deletions(-) -- 2.9.0 diff --git a/drivers/net/wireless/ath/wil6210/pcie_bus.c b/drivers/net/wireless/ath/wil6210/pcie_bus.c index 42a5480c764d..9e622ddcc0bb 100644 --- a/drivers/net/wireless/ath/wil6210/pcie_bus.c +++ b/drivers/net/wireless/ath/wil6210/pcie_bus.c @@ -31,10 +31,8 @@ static bool ftm_mode; module_param(ftm_mode, bool, 0444); MODULE_PARM_DESC(ftm_mode, " Set factory test mode, default - false"); -#ifdef CONFIG_PM static int wil6210_pm_notify(struct notifier_block *notify_block, unsigned long mode, void *unused); -#endif /* CONFIG_PM */ static void wil_set_capabilities(struct wil6210_priv *wil) @@ -307,15 +305,15 @@ static int wil_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto bus_disable; } -#ifdef CONFIG_PM - wil->pm_notify.notifier_call = wil6210_pm_notify; + if (IS_ENABLED(CONFIG_PM)) + wil->pm_notify.notifier_call = wil6210_pm_notify; + rc = register_pm_notifier(&wil->pm_notify); if (rc) /* Do not fail the driver initialization, as suspend can * be prevented in a later phase if needed */ wil_err(wil, "register_pm_notifier failed: %d\n", rc); -#endif /* CONFIG_PM */ wil6210_debugfs_init(wil); @@ -346,9 +344,7 @@ static void wil_pcie_remove(struct pci_dev *pdev) wil_dbg_misc(wil, "pcie_remove\n"); -#ifdef CONFIG_PM unregister_pm_notifier(&wil->pm_notify); -#endif /* CONFIG_PM */ wil_pm_runtime_forbid(wil); @@ -372,8 +368,6 @@ static const struct pci_device_id wil6210_pcie_ids[] = { }; MODULE_DEVICE_TABLE(pci, wil6210_pcie_ids); -#ifdef CONFIG_PM - static int wil6210_suspend(struct device *dev, bool is_runtime) { int rc = 0; @@ -481,17 +475,17 @@ static int wil6210_pm_notify(struct notifier_block *notify_block, return rc; } -static int wil6210_pm_suspend(struct device *dev) +static int __maybe_unused wil6210_pm_suspend(struct device *dev) { return wil6210_suspend(dev, false); } -static int wil6210_pm_resume(struct device *dev) +static int __maybe_unused wil6210_pm_resume(struct device *dev) { return wil6210_resume(dev, false); } -static int wil6210_pm_runtime_idle(struct device *dev) +static int __maybe_unused wil6210_pm_runtime_idle(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); struct wil6210_priv *wil = pci_get_drvdata(pdev); @@ -501,12 +495,12 @@ static int wil6210_pm_runtime_idle(struct device *dev) return wil_can_suspend(wil, true); } -static int wil6210_pm_runtime_resume(struct device *dev) +static int __maybe_unused wil6210_pm_runtime_resume(struct device *dev) { return wil6210_resume(dev, true); } -static int wil6210_pm_runtime_suspend(struct device *dev) +static int __maybe_unused wil6210_pm_runtime_suspend(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); struct wil6210_priv *wil = pci_get_drvdata(pdev); @@ -518,15 +512,12 @@ static int wil6210_pm_runtime_suspend(struct device *dev) return wil6210_suspend(dev, true); } -#endif /* CONFIG_PM */ static const struct dev_pm_ops wil6210_pm_ops = { -#ifdef CONFIG_PM SET_SYSTEM_SLEEP_PM_OPS(wil6210_pm_suspend, wil6210_pm_resume) SET_RUNTIME_PM_OPS(wil6210_pm_runtime_suspend, wil6210_pm_runtime_resume, wil6210_pm_runtime_idle) -#endif /* CONFIG_PM */ }; static struct pci_driver wil6210_driver = { diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h index cf27d9711dde..366a6ef222dc 100644 --- a/drivers/net/wireless/ath/wil6210/wil6210.h +++ b/drivers/net/wireless/ath/wil6210/wil6210.h @@ -742,9 +742,7 @@ struct wil6210_priv { int fw_calib_result; -#ifdef CONFIG_PM struct notifier_block pm_notify; -#endif /* CONFIG_PM */ bool suspend_resp_rcvd; bool suspend_resp_comp;