From patchwork Tue Oct 5 11:20:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 515242 Delivered-To: patch@linaro.org Received: by 2002:ac0:890a:0:0:0:0:0 with SMTP id 10csp1878348imy; Tue, 5 Oct 2021 04:21:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiMhAcId2G/Gz8aU9uUktVc/iTaFslwc6TyohAxh13tzv/Rz/fq0CtfC8lKhev24oiSrPP X-Received: by 2002:a17:902:7e88:b0:13e:91ec:4114 with SMTP id z8-20020a1709027e8800b0013e91ec4114mr4766714pla.30.1633432864112; Tue, 05 Oct 2021 04:21:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633432864; cv=none; d=google.com; s=arc-20160816; b=SyEgNJItiqu36FE682M2NwmDwAf+INHu4DtJjzutiumJaGq6fyq7x1fYZegZhfm9ay hkCGcKHWPHaeC9OQy7/jQEDqd25KwasuQFf94ALP5v7k/HSgMNQcdFzFbUZPF0vuii3w DawUq9uxV3P7dd07jCu4G8HANWEHapt8hyXKN8T5JxEAjzRcmB2TdOgk2oIt3zjdRtUX pRtKOb5TVXTqHH1z2VzvXiqA4zrYgBOVh+W+qh8c4bQK8F9x8xQCGDqyOXETWnwj0gR6 g8SozqFwN2EMZI2TTVmMpUcFzH6MSBWpysPHmwt84lDK3V8x4tMezUvi01jhj4WP0GSf vJKg== 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=rKekYIY69HoU0AksXMWW83/bQk6PgXmNpcOX48QCvik=; b=ZrcDiQ3KIe+vlXrTchjwu/xkOiAkKuwTEyepcB+ColoZyH+l/jeN4rsIsnJJfcDYLx 6laeN3Pf1YWb9ObHTT3D2Gg4AxeqDUrXLGA7ehUHqYI9nESs64AQn0NZNE+wwdcqwRYN /DtBIrxO+0+8Dsb+k2wqDg1QL4wKmPT9Bj9ZQpjNny44J3MX5MzkiJUNmiX6Rhw2goPl vwK7hjJQX17FiNoKM5raBt0nx+zmI9pDJ9D32SCp2PE7v9r67Bv2j1eK3Q+1bSmCWCtb uSdOqpmyKTf4e55XCVdTL7xdm2XSAuIqVA/Y0DMRWY6smWzYuImP2748DWbFgjDBeSg8 6zOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Eu4FspsP; 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 p3si23076543plo.446.2021.10.05.04.21.03; Tue, 05 Oct 2021 04:21:04 -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=Eu4FspsP; 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 S234352AbhJELWx (ORCPT + 4 others); Tue, 5 Oct 2021 07:22:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:48858 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234217AbhJELWw (ORCPT ); Tue, 5 Oct 2021 07:22:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6D25261425; Tue, 5 Oct 2021 11:21:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1633432862; bh=fvJpMHHEet+MaQV3Zx/ytB8336I76r/NnwK/oIOSVQg=; h=From:To:Cc:Subject:Date:From; b=Eu4FspsPS6S0lAkM8OXIpTWEuaWMOKYH8hGAEjkmHlox0ju828ZBmYSFq8cVKdhXi rOXXJqoPeLfDUtz6ZWW62u1qbyCLQhlFie34tILjIfW1L+x5K82lR1JeT246u0WdAF snOcyfvK8a3nal06gmex7k+cV4VwzbkvvdFYZV7oX0e8UzufkR/3jF7V76WUv99M/W qRP8tTz8gV2P6ctjnhCtzqqmAvqywPyFZs2cXCP95VTYlAPnRJBccVHee2p26BGIe5 dZrb4vSCzE5zLhBdBX1CK9ZY/R2EgCNvIaqD5z0DIakK3MgF/nW4XUNhRmOjL4pUzv tNN0wxt5ooNxg== From: Arnd Bergmann To: Mathias Nyman , Greg Kroah-Hartman Cc: Arnd Bergmann , JC Kuo , Thierry Reding , Jonathan Hunter , Yang Yingliang , linux-usb@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [v3] usb: xhci: tegra: mark PM functions as __maybe_unused Date: Tue, 5 Oct 2021 13:20:28 +0200 Message-Id: <20211005112057.2700888-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: 971ee247060d ("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 --- v3: fix reference to original commit. --- drivers/usb/host/xhci-tegra.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) -- 2.29.2 Acked-by: Thierry Reding 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,