From patchwork Tue Nov 15 16:05:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101524 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp1787241obn; Tue, 15 Nov 2016 08:06:30 -0800 (PST) X-Received: by 10.202.231.68 with SMTP id e65mr9005811oih.200.1479225990485; Tue, 15 Nov 2016 08:06:30 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u20si11119164oia.59.2016.11.15.08.06.30; Tue, 15 Nov 2016 08:06:30 -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 S1753174AbcKOQGU (ORCPT + 26 others); Tue, 15 Nov 2016 11:06:20 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:53940 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750998AbcKOQGT (ORCPT ); Tue, 15 Nov 2016 11:06:19 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.129]) with ESMTPA (Nemesis) id 0LkUgR-1cczzY1hG7-00cOP2; Tue, 15 Nov 2016 17:05:59 +0100 From: Arnd Bergmann To: Felipe Balbi , Greg Kroah-Hartman Cc: Arnd Bergmann , Heikki Krogerus , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] dwc3: make PM functions as __maybe_unused Date: Tue, 15 Nov 2016 17:05:43 +0100 Message-Id: <20161115160555.847337-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 MIME-Version: 1.0 X-Provags-ID: V03:K0:WVB53JZNyOnAiJvCat8YjlStwBEGDf77l4tmD7R98voukSoOqfX meiz5KhFZGSZ1okcgFAgzr9nhpOflvkbML5+kHuehPcCG+tlKolwNUoDf+vMhJSwszqszhv 07xjFQKCjuB3S7kuurfvllbgmy5Zehn/ZBled/W3SHdL1FIizriQRuIN2j3t6y2/uTEIsLv MzwlDG64x4SZk7UCQw5kw== X-UI-Out-Filterresults: notjunk:1; V01:K0:z1z6ha/IPLI=:XNyU4jg+68Bdid+Oat0iwH piVni+dQ4+nLMBPxk+Fm9O7BBtmmLnDFb/nFeHKXc8mxvbmxw5UgbEuh2PBqhLtj5u/vl5Re+ OXw19vrTy+DUgl1gKv4sdrW8dGRKP/JNfdk+zgAHxABnVgttKQ13VJo+7fT/m57BeHETU8G2L QqL/iq509DbJCdcC/Lv8YUw94DSZDPD36YKiplKLZwihMB6HeaaekilCTWxwmZ++A4+0SpPCb chLCqVGjV5T48xoT/eanRFOjIShHHABYiktFv1pSl5HvvO3q5wImc6VhMcItFA/jBM262+Mcu L60O4g4arvFhNpnJeqUOqQCCU3VEYszj50Dhj2lp0p+WtQCgM6PEjppQ6H/RHpIT/OWQcjZPZ DyRgEy8vRmILSKkCwqNwrBLvQDnT7vIz19nxRQLAjbh7KoIF3g3oANDCeNt/bA9gYkBXpGFWf EBAewhSd2alWwF5RX3oxo+z7E0Gumo5bnzMK+sxC2yRFCwbQxsPftY/SWqFZIvorwDls5MFyP yv8KV6CmDGFLeC0bLTOsdstNPQRsxf97sz5BXWDMqxmS50okI/YUWLptxoQTme3P1ZcgQxHMR ms0qJmDQ6mlcgOXEe1n8wD9l3Oq+FxXiwR8dsZ/O491F4idcytT5/hy93zk1W2DYMCsgxFikE DfpjapJr6c6cjy2uhn3fjGX2rPRnEoTb9Z+zP0qBAOegUrvwrvtov0uD/lXKSjH7yIcbdwBns OP0ZDw/EuMfMML5J Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A change to the suspend/resume handling in dwc3-pci introduced a harmless warning: drivers/usb/dwc3/dwc3-pci.c:169:12: error: ‘dwc3_pci_dsm’ defined but not used [-Werror=unused-function] Replacing the #ifdef around the PM functions with __maybe_unused annotations is the easiest way to make sure this doesn't happen again. A similar problem happened two months earlier and we ended up updating the #ifdef, but as it has come back now, I'd suggest going back to my earlier approach. Fixes: 9cecca75b5a0 ("usb: dwc3: pci: call _DSM for suspend/resume") Link: https://patchwork.kernel.org/patch/9318887/ Signed-off-by: Arnd Bergmann --- drivers/usb/dwc3/dwc3-pci.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) -- 2.9.0 diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index 8c39ec6522fd..771b620b4878 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c @@ -293,8 +293,7 @@ static const struct pci_device_id dwc3_pci_id_table[] = { }; MODULE_DEVICE_TABLE(pci, dwc3_pci_id_table); -#ifdef CONFIG_PM -static int dwc3_pci_runtime_suspend(struct device *dev) +static int __maybe_unused dwc3_pci_runtime_suspend(struct device *dev) { struct dwc3_pci *dwc = dev_get_drvdata(dev); @@ -304,7 +303,7 @@ static int dwc3_pci_runtime_suspend(struct device *dev) return -EBUSY; } -static int dwc3_pci_runtime_resume(struct device *dev) +static int __maybe_unused dwc3_pci_runtime_resume(struct device *dev) { struct dwc3_pci *dwc = dev_get_drvdata(dev); struct platform_device *dwc3 = dwc->dwc3; @@ -316,23 +315,20 @@ static int dwc3_pci_runtime_resume(struct device *dev) return pm_runtime_get(&dwc3->dev); } -#endif /* CONFIG_PM */ -#ifdef CONFIG_PM_SLEEP -static int dwc3_pci_suspend(struct device *dev) +static int __maybe_unused dwc3_pci_suspend(struct device *dev) { struct dwc3_pci *dwc = dev_get_drvdata(dev); return dwc3_pci_dsm(dwc, PCI_INTEL_BXT_STATE_D3); } -static int dwc3_pci_resume(struct device *dev) +static int __maybe_unused dwc3_pci_resume(struct device *dev) { struct dwc3_pci *dwc = dev_get_drvdata(dev); return dwc3_pci_dsm(dwc, PCI_INTEL_BXT_STATE_D0); } -#endif /* CONFIG_PM_SLEEP */ static struct dev_pm_ops dwc3_pci_dev_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(dwc3_pci_suspend, dwc3_pci_resume)