All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] phy: tegra: xusb: annotate PM functions as __maybe_unused
@ 2021-04-21 13:56 ` Arnd Bergmann
  0 siblings, 0 replies; 9+ messages in thread
From: Arnd Bergmann @ 2021-04-21 13:56 UTC (permalink / raw)
  To: JC Kuo, Kishon Vijay Abraham I, Vinod Koul, Thierry Reding,
	Jonathan Hunter
  Cc: Arnd Bergmann, Chunfeng Yun, Marc Zyngier, Rikard Falkeborn,
	linux-phy, linux-tegra, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

Depending on the configuration, there are no references to these
two helpers:

drivers/phy/tegra/xusb.c:1286:12: error: 'tegra_xusb_padctl_resume_noirq' defined but not used [-Werror=unused-function]
 1286 | static int tegra_xusb_padctl_resume_noirq(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/phy/tegra/xusb.c:1276:12: error: 'tegra_xusb_padctl_suspend_noirq' defined but not used [-Werror=unused-function]

Mark them as __maybe_unused to shut up the warnings without adding
fragile #ifdefs.

Fixes: b8bb3d9c9b74 ("phy: tegra: xusb: Add sleepwalk and suspend/resume")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/phy/tegra/xusb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
index 0aadac678191..963de5913e50 100644
--- a/drivers/phy/tegra/xusb.c
+++ b/drivers/phy/tegra/xusb.c
@@ -1273,7 +1273,7 @@ static int tegra_xusb_padctl_remove(struct platform_device *pdev)
 	return err;
 }
 
-static int tegra_xusb_padctl_suspend_noirq(struct device *dev)
+static __maybe_unused int tegra_xusb_padctl_suspend_noirq(struct device *dev)
 {
 	struct tegra_xusb_padctl *padctl = dev_get_drvdata(dev);
 
@@ -1283,7 +1283,7 @@ static int tegra_xusb_padctl_suspend_noirq(struct device *dev)
 	return 0;
 }
 
-static int tegra_xusb_padctl_resume_noirq(struct device *dev)
+static __maybe_unused int tegra_xusb_padctl_resume_noirq(struct device *dev)
 {
 	struct tegra_xusb_padctl *padctl = dev_get_drvdata(dev);
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 1/2] phy: tegra: xusb: annotate PM functions as __maybe_unused
@ 2021-04-21 13:56 ` Arnd Bergmann
  0 siblings, 0 replies; 9+ messages in thread
From: Arnd Bergmann @ 2021-04-21 13:56 UTC (permalink / raw)
  To: JC Kuo, Kishon Vijay Abraham I, Vinod Koul, Thierry Reding,
	Jonathan Hunter
  Cc: Arnd Bergmann, Chunfeng Yun, Marc Zyngier, Rikard Falkeborn,
	linux-phy, linux-tegra, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

Depending on the configuration, there are no references to these
two helpers:

drivers/phy/tegra/xusb.c:1286:12: error: 'tegra_xusb_padctl_resume_noirq' defined but not used [-Werror=unused-function]
 1286 | static int tegra_xusb_padctl_resume_noirq(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/phy/tegra/xusb.c:1276:12: error: 'tegra_xusb_padctl_suspend_noirq' defined but not used [-Werror=unused-function]

Mark them as __maybe_unused to shut up the warnings without adding
fragile #ifdefs.

Fixes: b8bb3d9c9b74 ("phy: tegra: xusb: Add sleepwalk and suspend/resume")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/phy/tegra/xusb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
index 0aadac678191..963de5913e50 100644
--- a/drivers/phy/tegra/xusb.c
+++ b/drivers/phy/tegra/xusb.c
@@ -1273,7 +1273,7 @@ static int tegra_xusb_padctl_remove(struct platform_device *pdev)
 	return err;
 }
 
-static int tegra_xusb_padctl_suspend_noirq(struct device *dev)
+static __maybe_unused int tegra_xusb_padctl_suspend_noirq(struct device *dev)
 {
 	struct tegra_xusb_padctl *padctl = dev_get_drvdata(dev);
 
@@ -1283,7 +1283,7 @@ static int tegra_xusb_padctl_suspend_noirq(struct device *dev)
 	return 0;
 }
 
-static int tegra_xusb_padctl_resume_noirq(struct device *dev)
+static __maybe_unused int tegra_xusb_padctl_resume_noirq(struct device *dev)
 {
 	struct tegra_xusb_padctl *padctl = dev_get_drvdata(dev);
 
-- 
2.29.2


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] usb: xhci: tegra: mark PM functions as __maybe_unused
  2021-04-21 13:56 ` Arnd Bergmann
  (?)
@ 2021-04-21 13:56 ` Arnd Bergmann
  2021-04-22  1:54   ` JC Kuo
  2021-04-22  2:06   ` JC Kuo
  -1 siblings, 2 replies; 9+ messages in thread
From: Arnd Bergmann @ 2021-04-21 13:56 UTC (permalink / raw)
  To: Mathias Nyman, Greg Kroah-Hartman, Thierry Reding,
	Jonathan Hunter, JC Kuo
  Cc: Arnd Bergmann, linux-usb, linux-tegra, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

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 <arnd@arndb.de>
---
 drivers/usb/host/xhci-tegra.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

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,
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] phy: tegra: xusb: annotate PM functions as __maybe_unused
  2021-04-21 13:56 ` Arnd Bergmann
@ 2021-04-22  1:50   ` JC Kuo
  -1 siblings, 0 replies; 9+ messages in thread
From: JC Kuo @ 2021-04-22  1:50 UTC (permalink / raw)
  To: Arnd Bergmann, Kishon Vijay Abraham I, Vinod Koul,
	Thierry Reding, Jonathan Hunter
  Cc: Arnd Bergmann, Chunfeng Yun, Marc Zyngier, Rikard Falkeborn,
	linux-phy, linux-tegra, linux-kernel

Hi Arnd,
Thanks for the fix.

Reviewed-by: JC Kuo <jckuo@nvidia.com>

On 4/21/21 9:56 PM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Depending on the configuration, there are no references to these
> two helpers:
> 
> drivers/phy/tegra/xusb.c:1286:12: error: 'tegra_xusb_padctl_resume_noirq' defined but not used [-Werror=unused-function]
>  1286 | static int tegra_xusb_padctl_resume_noirq(struct device *dev)
>       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/phy/tegra/xusb.c:1276:12: error: 'tegra_xusb_padctl_suspend_noirq' defined but not used [-Werror=unused-function]
> 
> Mark them as __maybe_unused to shut up the warnings without adding
> fragile #ifdefs.
> 
> Fixes: b8bb3d9c9b74 ("phy: tegra: xusb: Add sleepwalk and suspend/resume")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/phy/tegra/xusb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
> index 0aadac678191..963de5913e50 100644
> --- a/drivers/phy/tegra/xusb.c
> +++ b/drivers/phy/tegra/xusb.c
> @@ -1273,7 +1273,7 @@ static int tegra_xusb_padctl_remove(struct platform_device *pdev)
>  	return err;
>  }
>  
> -static int tegra_xusb_padctl_suspend_noirq(struct device *dev)
> +static __maybe_unused int tegra_xusb_padctl_suspend_noirq(struct device *dev)
>  {
>  	struct tegra_xusb_padctl *padctl = dev_get_drvdata(dev);
>  
> @@ -1283,7 +1283,7 @@ static int tegra_xusb_padctl_suspend_noirq(struct device *dev)
>  	return 0;
>  }
>  
> -static int tegra_xusb_padctl_resume_noirq(struct device *dev)
> +static __maybe_unused int tegra_xusb_padctl_resume_noirq(struct device *dev)
>  {
>  	struct tegra_xusb_padctl *padctl = dev_get_drvdata(dev);
>  
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] phy: tegra: xusb: annotate PM functions as __maybe_unused
@ 2021-04-22  1:50   ` JC Kuo
  0 siblings, 0 replies; 9+ messages in thread
From: JC Kuo @ 2021-04-22  1:50 UTC (permalink / raw)
  To: Arnd Bergmann, Kishon Vijay Abraham I, Vinod Koul,
	Thierry Reding, Jonathan Hunter
  Cc: Arnd Bergmann, Chunfeng Yun, Marc Zyngier, Rikard Falkeborn,
	linux-phy, linux-tegra, linux-kernel

Hi Arnd,
Thanks for the fix.

Reviewed-by: JC Kuo <jckuo@nvidia.com>

On 4/21/21 9:56 PM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Depending on the configuration, there are no references to these
> two helpers:
> 
> drivers/phy/tegra/xusb.c:1286:12: error: 'tegra_xusb_padctl_resume_noirq' defined but not used [-Werror=unused-function]
>  1286 | static int tegra_xusb_padctl_resume_noirq(struct device *dev)
>       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/phy/tegra/xusb.c:1276:12: error: 'tegra_xusb_padctl_suspend_noirq' defined but not used [-Werror=unused-function]
> 
> Mark them as __maybe_unused to shut up the warnings without adding
> fragile #ifdefs.
> 
> Fixes: b8bb3d9c9b74 ("phy: tegra: xusb: Add sleepwalk and suspend/resume")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/phy/tegra/xusb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
> index 0aadac678191..963de5913e50 100644
> --- a/drivers/phy/tegra/xusb.c
> +++ b/drivers/phy/tegra/xusb.c
> @@ -1273,7 +1273,7 @@ static int tegra_xusb_padctl_remove(struct platform_device *pdev)
>  	return err;
>  }
>  
> -static int tegra_xusb_padctl_suspend_noirq(struct device *dev)
> +static __maybe_unused int tegra_xusb_padctl_suspend_noirq(struct device *dev)
>  {
>  	struct tegra_xusb_padctl *padctl = dev_get_drvdata(dev);
>  
> @@ -1283,7 +1283,7 @@ static int tegra_xusb_padctl_suspend_noirq(struct device *dev)
>  	return 0;
>  }
>  
> -static int tegra_xusb_padctl_resume_noirq(struct device *dev)
> +static __maybe_unused int tegra_xusb_padctl_resume_noirq(struct device *dev)
>  {
>  	struct tegra_xusb_padctl *padctl = dev_get_drvdata(dev);
>  
> 

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] usb: xhci: tegra: mark PM functions as __maybe_unused
  2021-04-21 13:56 ` [PATCH 2/2] usb: xhci: tegra: mark " Arnd Bergmann
@ 2021-04-22  1:54   ` JC Kuo
  2021-04-22  2:06   ` JC Kuo
  1 sibling, 0 replies; 9+ messages in thread
From: JC Kuo @ 2021-04-22  1:54 UTC (permalink / raw)
  To: Arnd Bergmann, Mathias Nyman, Greg Kroah-Hartman, Thierry Reding,
	Jonathan Hunter
  Cc: Arnd Bergmann, linux-usb, linux-tegra, linux-kernel

Hi Arnd,
Thanks for the fix.

Reviewed-by: JC Kuo <jckuo@nvidia.com>


On 4/21/21 9:56 PM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> 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 <arnd@arndb.de>
> ---
>  drivers/usb/host/xhci-tegra.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> 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,
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] phy: tegra: xusb: annotate PM functions as __maybe_unused
  2021-04-21 13:56 ` Arnd Bergmann
@ 2021-04-22  2:05   ` JC Kuo
  -1 siblings, 0 replies; 9+ messages in thread
From: JC Kuo @ 2021-04-22  2:05 UTC (permalink / raw)
  To: Arnd Bergmann, Kishon Vijay Abraham I, Vinod Koul,
	Thierry Reding, Jonathan Hunter
  Cc: Arnd Bergmann, Chunfeng Yun, Marc Zyngier, Rikard Falkeborn,
	linux-phy, linux-tegra, linux-kernel

Hi Arnd,
Thanks for the fix.

Reviewed-by: JC Kuo <jckuo@nvidia.com>


On 4/21/21 9:56 PM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Depending on the configuration, there are no references to these
> two helpers:
> 
> drivers/phy/tegra/xusb.c:1286:12: error: 'tegra_xusb_padctl_resume_noirq' defined but not used [-Werror=unused-function]
>  1286 | static int tegra_xusb_padctl_resume_noirq(struct device *dev)
>       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/phy/tegra/xusb.c:1276:12: error: 'tegra_xusb_padctl_suspend_noirq' defined but not used [-Werror=unused-function]
> 
> Mark them as __maybe_unused to shut up the warnings without adding
> fragile #ifdefs.
> 
> Fixes: b8bb3d9c9b74 ("phy: tegra: xusb: Add sleepwalk and suspend/resume")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/phy/tegra/xusb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
> index 0aadac678191..963de5913e50 100644
> --- a/drivers/phy/tegra/xusb.c
> +++ b/drivers/phy/tegra/xusb.c
> @@ -1273,7 +1273,7 @@ static int tegra_xusb_padctl_remove(struct platform_device *pdev)
>  	return err;
>  }
>  
> -static int tegra_xusb_padctl_suspend_noirq(struct device *dev)
> +static __maybe_unused int tegra_xusb_padctl_suspend_noirq(struct device *dev)
>  {
>  	struct tegra_xusb_padctl *padctl = dev_get_drvdata(dev);
>  
> @@ -1283,7 +1283,7 @@ static int tegra_xusb_padctl_suspend_noirq(struct device *dev)
>  	return 0;
>  }
>  
> -static int tegra_xusb_padctl_resume_noirq(struct device *dev)
> +static __maybe_unused int tegra_xusb_padctl_resume_noirq(struct device *dev)
>  {
>  	struct tegra_xusb_padctl *padctl = dev_get_drvdata(dev);
>  
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] phy: tegra: xusb: annotate PM functions as __maybe_unused
@ 2021-04-22  2:05   ` JC Kuo
  0 siblings, 0 replies; 9+ messages in thread
From: JC Kuo @ 2021-04-22  2:05 UTC (permalink / raw)
  To: Arnd Bergmann, Kishon Vijay Abraham I, Vinod Koul,
	Thierry Reding, Jonathan Hunter
  Cc: Arnd Bergmann, Chunfeng Yun, Marc Zyngier, Rikard Falkeborn,
	linux-phy, linux-tegra, linux-kernel

Hi Arnd,
Thanks for the fix.

Reviewed-by: JC Kuo <jckuo@nvidia.com>


On 4/21/21 9:56 PM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Depending on the configuration, there are no references to these
> two helpers:
> 
> drivers/phy/tegra/xusb.c:1286:12: error: 'tegra_xusb_padctl_resume_noirq' defined but not used [-Werror=unused-function]
>  1286 | static int tegra_xusb_padctl_resume_noirq(struct device *dev)
>       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/phy/tegra/xusb.c:1276:12: error: 'tegra_xusb_padctl_suspend_noirq' defined but not used [-Werror=unused-function]
> 
> Mark them as __maybe_unused to shut up the warnings without adding
> fragile #ifdefs.
> 
> Fixes: b8bb3d9c9b74 ("phy: tegra: xusb: Add sleepwalk and suspend/resume")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/phy/tegra/xusb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
> index 0aadac678191..963de5913e50 100644
> --- a/drivers/phy/tegra/xusb.c
> +++ b/drivers/phy/tegra/xusb.c
> @@ -1273,7 +1273,7 @@ static int tegra_xusb_padctl_remove(struct platform_device *pdev)
>  	return err;
>  }
>  
> -static int tegra_xusb_padctl_suspend_noirq(struct device *dev)
> +static __maybe_unused int tegra_xusb_padctl_suspend_noirq(struct device *dev)
>  {
>  	struct tegra_xusb_padctl *padctl = dev_get_drvdata(dev);
>  
> @@ -1283,7 +1283,7 @@ static int tegra_xusb_padctl_suspend_noirq(struct device *dev)
>  	return 0;
>  }
>  
> -static int tegra_xusb_padctl_resume_noirq(struct device *dev)
> +static __maybe_unused int tegra_xusb_padctl_resume_noirq(struct device *dev)
>  {
>  	struct tegra_xusb_padctl *padctl = dev_get_drvdata(dev);
>  
> 

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] usb: xhci: tegra: mark PM functions as __maybe_unused
  2021-04-21 13:56 ` [PATCH 2/2] usb: xhci: tegra: mark " Arnd Bergmann
  2021-04-22  1:54   ` JC Kuo
@ 2021-04-22  2:06   ` JC Kuo
  1 sibling, 0 replies; 9+ messages in thread
From: JC Kuo @ 2021-04-22  2:06 UTC (permalink / raw)
  To: Arnd Bergmann, Mathias Nyman, Greg Kroah-Hartman, Thierry Reding,
	Jonathan Hunter
  Cc: Arnd Bergmann, linux-usb, linux-tegra, linux-kernel

Hi Arnd,
Thanks for the fix.

Reviewed-by: JC Kuo <jckuo@nvidia.com>


On 4/21/21 9:56 PM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> 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 <arnd@arndb.de>
> ---
>  drivers/usb/host/xhci-tegra.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> 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,
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-04-22  2:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21 13:56 [PATCH 1/2] phy: tegra: xusb: annotate PM functions as __maybe_unused Arnd Bergmann
2021-04-21 13:56 ` Arnd Bergmann
2021-04-21 13:56 ` [PATCH 2/2] usb: xhci: tegra: mark " Arnd Bergmann
2021-04-22  1:54   ` JC Kuo
2021-04-22  2:06   ` JC Kuo
2021-04-22  1:50 ` [PATCH 1/2] phy: tegra: xusb: annotate " JC Kuo
2021-04-22  1:50   ` JC Kuo
2021-04-22  2:05 ` JC Kuo
2021-04-22  2:05   ` JC Kuo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.