From patchwork Mon Aug 13 21:56:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 144053 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3568565ljj; Mon, 13 Aug 2018 14:57:29 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyS5CdxID0NFYw74/jVWr5VhU/mzzUaIBm/A5q4qOz3pgeA1FZSA8Glzu6GFK3TQ1cZ8BbX X-Received: by 2002:a17:902:e28b:: with SMTP id cf11-v6mr18269625plb.86.1534197449211; Mon, 13 Aug 2018 14:57:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534197449; cv=none; d=google.com; s=arc-20160816; b=yavI3FNHooJ5y9mdBNQIDCuKjGVV4z2xJ3xPZdS26tvG2Fa6z1J7i5f3EqdYp5LpPV YcKMTWaaVofHwghWfzSAlTr3uCEXj2XxYRQZUfBrj2xo5pOqJBB3h1QCsaF95gNxtT9S U3waUyzDyWR81r7L4yavLpyuHjYg8lN78DCWfsTOtGbIJGi8aBdjBL9FXUZqVkXehSiG HFFc6vkpsSfSJK9pf2i8cpbVE9OwiBJzdyR0VRSSeCmn8kPvk9KC1KTp+enhkSeioyUM 7LJSIUv1G9cqA2xbTE4JCphnZBFEp6uTxLJSUjiEO2zAxoKRBklQ+66d1mC6ry5FBviC QMoQ== 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=nwkPn0t3ZoCdquhKs7eiF2vjlBZfrxXJQVyUH/FgjgM=; b=HpswUclHnChtw9cSVy9C7iQhmPK77JUemnlF7VNHc5dVMmT/QpYYQRCqU3fy1NECVy JfZbQSxGf0VaOlrrSHDJsuAIGThnBcZP+yxtMRIl0Ua6BrZ+ZfvkebsyKbWIUOh3gKFz sqP1R7WnNGmQh9aa/Mu2J4cYQNOAoNHb40fguV98MmGIpiBGSz3X47Cm3q+39w1dv0Ig MlUXG92oIOeonLK+0MiOdW5cyn5NGn6PVby6Q7Ovj3LDDcly8Ng8MrdxYO2U7k3upzjs g9FX/Sr18SD3lUjktQKEbp+a0NHIxn4JIfLBxk6vMTzmQcjluGaRMMbsfI6iyXsc9d84 uusw== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l6-v6si19031037pfc.298.2018.08.13.14.57.28; Mon, 13 Aug 2018 14:57:29 -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; 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 S1731036AbeHNAlc (ORCPT + 31 others); Mon, 13 Aug 2018 20:41:32 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:33283 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729380AbeHNAlc (ORCPT ); Mon, 13 Aug 2018 20:41:32 -0400 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0MbgsX-1fYUPL1amT-00J4E4; Mon, 13 Aug 2018 23:57:18 +0200 From: Arnd Bergmann To: Felipe Balbi , Greg Kroah-Hartman Cc: Arnd Bergmann , Johan Hovold , Vivek Gautam , Enric Balletbo i Serra , Martin Blumenstingl , Shawn Guo , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: dwc3: of-simple: avoid unused function warnings Date: Mon, 13 Aug 2018 23:56:55 +0200 Message-Id: <20180813215717.3903813-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:wUqf3N0ydJl8a7zthaPEY1pduLfA65wwDT27xaM8sIVLncnOX8b 1iUEL4gi9dDlBkVM1xY2jR2qgrezsMmUYE1vlbptu0HzIFW9O4iHYzSSQss9KirnvthnzQw lnO4xlbdvYs3gMigfhZ4RKc/cBTU3M22+mTCO8vv9GgrJNZT5CsMwdrf3b8EFrtyriKEYAI fw/tDJ5tsHYEZcXE7Zuvg== X-UI-Out-Filterresults: notjunk:1; V01:K0:zFFLfxh5b9Y=:Oh3DV5+/h264TY2IeYfGZR kV3KcBBtAFMoxajYiao0+gyp9HcbAHP83p+qOoOTB9RpvX4dIdCA5fKxq8BMKJbUapr38+mLF SUeQQ3iAGGBUWA1Jnq3KCkB9yoGcZHZEyqwbsBD7ePE76zzIpmmvvWoQvVQdJGkiS3o1P95a1 PmKAGseIrfFIMaZtKogkZlCMsZ1TLXArHuzzjoixO2Hr8DX/iMvXoLzEUKsnQobvSzYRQzOTI xrBgSMMPaBXkPfQ+i04rojVKp26oKlT04R7L+wAN+hTuleM7tJaNWR6b7GXcMRiUwb+tFmgPd 8U1flLrH+HSneLfVepB40mHZQDOp2Fy+JmCxuaVBdMsIVpt1bDwx3YSxUeLifYU1eKrkACzks IS67CE/E951rphLB70UoSw8mmndvyVxZZCcnlt4W1kNSu8Y/XOZp+cgcW+JZ7OrwKagq3b6MH FuM6oh7d/mVJCqBCD1AXONwggH2/HR3wLvOdhlv0HDfIweD94dfB6hz7T3hQCNbrIUxu+xUyd +pbf85S1dl72IR+IXBKXG71ybq8AsfyJh6g3KN3kN+DT2/2xIWb2o8cMJx+H314uMnTFjLHHS GawyyT1miyjKqgRbbe696K/gaMZLJ/xPpy/z7WVeuiZYjZF+K0JxirD4076ece2+IODJGpsdO P16g0Fg/OxBrTEVJgAsqYo47IYXuu5CsCVSvWDoIL3QKAXNB9pHJiq5k3zdrWvr0yaSA= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org An incorrect #ifdef caused a pair of harmless warnings when CONFIG_PM_SLEEP is disabled: drivers/usb/dwc3/dwc3-of-simple.c:223:12: error: 'dwc3_of_simple_resume' defined but not used [-Werror=unused-function] static int dwc3_of_simple_resume(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~ drivers/usb/dwc3/dwc3-of-simple.c:213:12: error: 'dwc3_of_simple_suspend' defined but not used [-Werror=unused-function] static int dwc3_of_simple_suspend(struct device *dev) Since the #ifdef method is generally hard to get right, use a simpler __maybe_unused annotation here to let the compiler drop the unused functions silently. This also improves compile-time coverage. Fixes: 76251db86561 ("usb: dwc3: of-simple: reset host controller at suspend/resume") Signed-off-by: Arnd Bergmann --- drivers/usb/dwc3/dwc3-of-simple.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) -- 2.18.0 diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c index 40bf9e0bbc59..4c2771c5e727 100644 --- a/drivers/usb/dwc3/dwc3-of-simple.c +++ b/drivers/usb/dwc3/dwc3-of-simple.c @@ -180,8 +180,7 @@ static int dwc3_of_simple_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM -static int dwc3_of_simple_runtime_suspend(struct device *dev) +static int __maybe_unused dwc3_of_simple_runtime_suspend(struct device *dev) { struct dwc3_of_simple *simple = dev_get_drvdata(dev); int i; @@ -192,7 +191,7 @@ static int dwc3_of_simple_runtime_suspend(struct device *dev) return 0; } -static int dwc3_of_simple_runtime_resume(struct device *dev) +static int __maybe_unused dwc3_of_simple_runtime_resume(struct device *dev) { struct dwc3_of_simple *simple = dev_get_drvdata(dev); int ret; @@ -210,7 +209,7 @@ static int dwc3_of_simple_runtime_resume(struct device *dev) return 0; } -static int dwc3_of_simple_suspend(struct device *dev) +static int __maybe_unused dwc3_of_simple_suspend(struct device *dev) { struct dwc3_of_simple *simple = dev_get_drvdata(dev); @@ -220,7 +219,7 @@ static int dwc3_of_simple_suspend(struct device *dev) return 0; } -static int dwc3_of_simple_resume(struct device *dev) +static int __maybe_unused dwc3_of_simple_resume(struct device *dev) { struct dwc3_of_simple *simple = dev_get_drvdata(dev); @@ -229,7 +228,6 @@ static int dwc3_of_simple_resume(struct device *dev) return 0; } -#endif static const struct dev_pm_ops dwc3_of_simple_dev_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(dwc3_of_simple_suspend, dwc3_of_simple_resume)