From patchwork Wed Apr 21 13:56:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 425292 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp351834jao; Wed, 21 Apr 2021 06:56:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxp/VgM/3u61s0cLU1XLYUBJrGuPH1SpOV3zo9miz0Vo5meXuAyATxp7or/zASt3hawHXHZ X-Received: by 2002:a17:907:3f08:: with SMTP id hq8mr33495725ejc.90.1619013405521; Wed, 21 Apr 2021 06:56:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619013405; cv=none; d=google.com; s=arc-20160816; b=Ssw7XPc38yYm04sO6VX6fRbARFs56VGOQCukPjUeLND8Pd89zOiO04a0McjKCNrNCC +Rq8tUGFoG4y19J5HzhTFkTrCdsY9B54DWmg9gbpPcqDCQ6vIzRHy9vi5UGz5IQGySSn oXD0JO8kQICKJDCdmM4A7X3/ZVM0ENX6iJfTSk8Xqj6GDJUdBwkLwUmyKazuFwkbA52e 4N7oWDxZvHWR/quobSdwAoDqPTjDFnBhz32bXsQi+8woluB8uCyFCfp67mHU5gfSN/rs 0D8fg1/6YKHHhy8gjFHqFiWNKv/4Lcn7E5Q23H+shBZPWEHUCaiP2ezOxrzVctxmCrkd W6Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xQQFWGwSEt1lveHjtCW03imp9k5bvw1Fnul5A12JOvQ=; b=VfeM/xyK/Isr3PiEOUk2NzeeEK91CMv+iU4QOFNJ2Avj8IsxGvfZ2gN2mNIpm2iTjP slG0UI4cFWAPI6Tga78LbdNaSFJeH1jW3lEldpJM7vsDAMBYR5RCmfVZLPTW336JiWzN FEVFsYZq0XX53AQ67K1AdS602DbTjjx7Rsqmpmo4XOUUJlpp8dfu3JM4m0QIYCevbY0l +JFNaAZ7NFwcvQwsNe+DjBeJ5fHvZ8mLQeSq0z+00t694CusDV8lyEEnJ1TSR7lUH68p UM1NoROF1/DNWcs1xsxwuDVLrxWS3IB74BW/eElC/npXUJ3qR8GIKLAcqbF4T4NWiyWy iYuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l+r1yXye; spf=pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q26si1964520eji.19.2021.04.21.06.56.45; Wed, 21 Apr 2021 06:56:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l+r1yXye; spf=pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243050AbhDUN5P (ORCPT + 3 others); Wed, 21 Apr 2021 09:57:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:33658 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243038AbhDUN5C (ORCPT ); Wed, 21 Apr 2021 09:57:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EF0856144D; Wed, 21 Apr 2021 13:56:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619013388; bh=JR07JyZ8UJK9Zsnb9BH+u/PKpxm352xvttxjWOx5aBs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l+r1yXyeUlRi9sVm1chURKaj1i2uwzcMbWJMnZhh71vhfeVccP7cdQsoHOf4r0Wsp 1njXtVY6aX03USXocTSFlbMaV2Z1HdF5Wd0OkdG5GtWL271SC4G+0Z+OJKN9BIAWRk E3lSMn61pWwq1SL9zD3OH9nAAmuoUeN5LuwQMjxir8lEFLP+ZHhcWvh+8m8n0vdDtc VlCnjbIQ5L/5nRuW0BMf9tv/c4wQgKKmYPoq6fGqwMnQidwpf9xoiRtV/dKnrK3ojL zi/h0UsEIOD4iSEegQQapZn/N7J/2XEpbKiMDtVT/syUoOk/4dJIKRQEqVD8GiDK5O nhbijk43v9Oyw== From: Arnd Bergmann To: Mathias Nyman , Greg Kroah-Hartman , Thierry Reding , Jonathan Hunter , JC Kuo Cc: Arnd Bergmann , linux-usb@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] usb: xhci: tegra: mark PM functions as __maybe_unused Date: Wed, 21 Apr 2021 15:56:08 +0200 Message-Id: <20210421135613.3560777-2-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210421135613.3560777-1-arnd@kernel.org> References: <20210421135613.3560777-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Arnd Bergmann The added #ifdefs in the PM rework were almost correct, but still cause warnings in some randconfig builds: drivers/usb/host/xhci-tegra.c:2147:12: error: 'tegra_xusb_resume' defined but not used [-Werror=unused-function] 2147 | static int tegra_xusb_resume(struct device *dev) | ^~~~~~~~~~~~~~~~~ drivers/usb/host/xhci-tegra.c:2105:12: error: 'tegra_xusb_suspend' defined but not used [-Werror=unused-function] 2105 | static int tegra_xusb_suspend(struct device *dev) Replace the #ifdef checks with simpler __maybe_unused annotations to reliably shut up these warnings. Fixes: d64d362f1d8b ("usb: xhci: tegra: Enable ELPG for runtime/system PM") Signed-off-by: Arnd Bergmann --- drivers/usb/host/xhci-tegra.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) -- 2.29.2 Reviewed-by: JC Kuo Reviewed-by: JC Kuo diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c index ce97ff054c68..adead2377149 100644 --- a/drivers/usb/host/xhci-tegra.c +++ b/drivers/usb/host/xhci-tegra.c @@ -1787,7 +1787,6 @@ static int tegra_xusb_remove(struct platform_device *pdev) return 0; } -#if IS_ENABLED(CONFIG_PM) || IS_ENABLED(CONFIG_PM_SLEEP) static bool xhci_hub_ports_suspended(struct xhci_hub *hub) { struct device *dev = hub->hcd->self.controller; @@ -2102,7 +2101,7 @@ static int tegra_xusb_exit_elpg(struct tegra_xusb *tegra, bool runtime) return err; } -static int tegra_xusb_suspend(struct device *dev) +static __maybe_unused int tegra_xusb_suspend(struct device *dev) { struct tegra_xusb *tegra = dev_get_drvdata(dev); int err; @@ -2144,7 +2143,7 @@ static int tegra_xusb_suspend(struct device *dev) return err; } -static int tegra_xusb_resume(struct device *dev) +static __maybe_unused int tegra_xusb_resume(struct device *dev) { struct tegra_xusb *tegra = dev_get_drvdata(dev); int err; @@ -2174,10 +2173,8 @@ static int tegra_xusb_resume(struct device *dev) return 0; } -#endif -#ifdef CONFIG_PM -static int tegra_xusb_runtime_suspend(struct device *dev) +static __maybe_unused int tegra_xusb_runtime_suspend(struct device *dev) { struct tegra_xusb *tegra = dev_get_drvdata(dev); int ret; @@ -2190,7 +2187,7 @@ static int tegra_xusb_runtime_suspend(struct device *dev) return ret; } -static int tegra_xusb_runtime_resume(struct device *dev) +static __maybe_unused int tegra_xusb_runtime_resume(struct device *dev) { struct tegra_xusb *tegra = dev_get_drvdata(dev); int err; @@ -2201,7 +2198,6 @@ static int tegra_xusb_runtime_resume(struct device *dev) return err; } -#endif static const struct dev_pm_ops tegra_xusb_pm_ops = { SET_RUNTIME_PM_OPS(tegra_xusb_runtime_suspend,