From patchwork Mon Sep 27 14:22:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 514721 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp4169480jao; Mon, 27 Sep 2021 07:23:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUH64trKuCQdY6QsRk9nmkDYXEripva9Y6xX0kaMzpvGbdjttGeZe6HqOl1i/TRtKYiqqR X-Received: by 2002:aa7:9e0d:0:b0:447:cd37:b36d with SMTP id y13-20020aa79e0d000000b00447cd37b36dmr167258pfq.71.1632752589887; Mon, 27 Sep 2021 07:23:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632752589; cv=none; d=google.com; s=arc-20160816; b=bFExnIpkywZeCvQ2mquO4fXPLiJQ1oK7+/tnpVJyatMsk+o1WoB3HFGvNy917nmALl Rms70lgui7R4HpbgmsRutNHVgJnukkovq4CcaLF5Ej+kLHHd7H25CVPBznEIGOYrB5Ig UNlcVy+doBk4XbjKTBlk8l6QLHgy8UuASIHX+lHguoY8DPEMUAUh1xjmykfvhXAnw8kZ 2SVqrUpL+8EbmJTMRnaab9y7211dMHBqA7Iv8QtY93ueSb8fM9nCmLHQmtIbACUw+93w WTDtiRvPR8LSQbqd94p6IPJjn9yzCMBHW6k239XsdYMNr+rcF1k7GgHE7jhKRKCLltpL h4/Q== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=8dqQ7bUS8AUbDe9FCpfdPCEHJNOjy1rx9seoWSqVqec=; b=l3V7dDD7Hsw4ROwoG7XuDVF2vv6ampdMrelJtFLRhjwsbeMoFhmo34x0dAThbjOr6E 8vX0oJTl3kL8MbysQgCl4Iqkdd8fmgyoPgULGKGo9vFot14Knfim8rQZJLH47ahFUtsH rZd6ds5u+EO3FDgmZx/A0B1BhWgk69YyXNk/pZIvZ/YasOjKbhgvzKz62a3tBf8IbhIS 2xvNt7yaCfYmdPHBx9S1031ooKzzgAWOIQhmBEnh8EjCSlpCwapKW0jDx+c53KWRmYlN OZ3jZiAq74N1W7IvTwMM3ys0t7vuqMlBfRqW909U0SD4Op154dGDwXR/9kRxiEdN/QSJ rhNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Yv0VMjut; 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 c10si20593545pfo.128.2021.09.27.07.23.09; Mon, 27 Sep 2021 07:23:09 -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=Yv0VMjut; 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 S234789AbhI0OYl (ORCPT + 4 others); Mon, 27 Sep 2021 10:24:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:35286 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234730AbhI0OYl (ORCPT ); Mon, 27 Sep 2021 10:24:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 24C0E60FD7; Mon, 27 Sep 2021 14:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632752583; bh=ZQ/mzkuYyFwT1Vg8d4ghbZ2fcO4h2gXnjki81+LWF5Y=; h=From:To:Cc:Subject:Date:From; b=Yv0VMjutnYt7YpQlCSbAgV0KeX2YXrxL/4sUyQ5s199wKNJMtWhhnpyE1whB3y7PE lt3x/Tyo1i1MMEq944grqooDLXMYLtZs5zXKdA/YnngXi1h3ZOr7lOIYEEqUqPBhf+ IOTKuqb7pZfVQ6GPDe9KdepjYE4EYLCue0ajI/D8LlErWm+9KKxf32Kc3Q1vm6DHW1 PjEm4wwPsbn5/O7YMyx7oqZfv6U4I0H4VCYZFxmwOJ5aboPUr4QuUAVxNGNGN7dPcW 0IVdx10f/+mIqcLkvpKfYm+ZCnpkr66Ycvy7noYzKUPUnVf3HqiHHbBw0Q3gFP6Qui Rc1P8QYKjdqrQ== From: Arnd Bergmann To: Mathias Nyman , Greg Kroah-Hartman , Thierry Reding , Jonathan Hunter , JC Kuo Cc: Arnd Bergmann , Yang Yingliang , Petr Mladek , Andy Shevchenko , linux-usb@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [RESEND] usb: xhci: tegra: mark PM functions as __maybe_unused Date: Mon, 27 Sep 2021 16:22:52 +0200 Message-Id: <20210927142258.1863321-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 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") Reviewed-by: JC Kuo Link: https://lore.kernel.org/all/20210421135613.3560777-2-arnd@kernel.org/ Signed-off-by: Arnd Bergmann --- drivers/usb/host/xhci-tegra.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) -- 2.29.2 diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c index 575fa89a783f..1bf494b649bd 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,