All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: stmmac: platform: fix build error with !CONFIG_PM_SLEEP
@ 2021-03-22 12:23 ` 'w00385741
  0 siblings, 0 replies; 4+ messages in thread
From: 'w00385741 @ 2021-03-22 12:23 UTC (permalink / raw)
  To: weiyongjun1, Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
	Jakub Kicinski, Maxime Coquelin, Philipp Zabel, Russell King,
	Joakim Zhang
  Cc: netdev, linux-stm32, linux-arm-kernel, kernel-janitors, Hulk Robot

From: Wei Yongjun <weiyongjun1@huawei.com>

Get rid of the CONFIG_PM_SLEEP ifdefery to fix the build error
and use __maybe_unused for the suspend()/resume() hooks to avoid
build warning:

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:769:21:
 error: 'stmmac_runtime_suspend' undeclared here (not in a function); did you mean 'stmmac_suspend'?
  769 |  SET_RUNTIME_PM_OPS(stmmac_runtime_suspend, stmmac_runtime_resume, NULL)
      |                     ^~~~~~~~~~~~~~~~~~~~~~
./include/linux/pm.h:342:21: note: in definition of macro 'SET_RUNTIME_PM_OPS'
  342 |  .runtime_suspend = suspend_fn, \
      |                     ^~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:769:45:
 error: 'stmmac_runtime_resume' undeclared here (not in a function)
  769 |  SET_RUNTIME_PM_OPS(stmmac_runtime_suspend, stmmac_runtime_resume, NULL)
      |                                             ^~~~~~~~~~~~~~~~~~~~~
./include/linux/pm.h:343:20: note: in definition of macro 'SET_RUNTIME_PM_OPS'
  343 |  .runtime_resume = resume_fn, \
      |                    ^~~~~~~~~

Fixes: 5ec55823438e ("net: stmmac: add clocks management for gmac driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 .../stmicro/stmmac/stmmac_platform.c       | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index a70b0bc84b2a..5a1e018884e6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -704,7 +704,6 @@ int stmmac_pltfr_remove(struct platform_device *pdev)
 }
 EXPORT_SYMBOL_GPL(stmmac_pltfr_remove);
 
-#ifdef CONFIG_PM_SLEEP
 /**
  * stmmac_pltfr_suspend
  * @dev: device pointer
@@ -712,7 +711,7 @@ EXPORT_SYMBOL_GPL(stmmac_pltfr_remove);
  * call the main suspend function and then, if required, on some platform, it
  * can call an exit helper.
  */
-static int stmmac_pltfr_suspend(struct device *dev)
+static int __maybe_unused stmmac_pltfr_suspend(struct device *dev)
 {
 	int ret;
 	struct net_device *ndev = dev_get_drvdata(dev);
@@ -733,7 +732,7 @@ static int stmmac_pltfr_suspend(struct device *dev)
  * the main resume function, on some platforms, it can call own init helper
  * if required.
  */
-static int stmmac_pltfr_resume(struct device *dev)
+static int __maybe_unused stmmac_pltfr_resume(struct device *dev)
 {
 	struct net_device *ndev = dev_get_drvdata(dev);
 	struct stmmac_priv *priv = netdev_priv(ndev);
@@ -745,7 +744,7 @@ static int stmmac_pltfr_resume(struct device *dev)
 	return stmmac_resume(dev);
 }
 
-static int stmmac_runtime_suspend(struct device *dev)
+static int __maybe_unused stmmac_runtime_suspend(struct device *dev)
 {
 	struct net_device *ndev = dev_get_drvdata(dev);
 	struct stmmac_priv *priv = netdev_priv(ndev);
@@ -755,14 +754,13 @@ static int stmmac_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int stmmac_runtime_resume(struct device *dev)
+static int __maybe_unused stmmac_runtime_resume(struct device *dev)
 {
 	struct net_device *ndev = dev_get_drvdata(dev);
 	struct stmmac_priv *priv = netdev_priv(ndev);
 
 	return stmmac_bus_clks_config(priv, true);
 }
-#endif /* CONFIG_PM_SLEEP */
 
 const struct dev_pm_ops stmmac_pltfr_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(stmmac_pltfr_suspend, stmmac_pltfr_resume)


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

* [PATCH net-next] net: stmmac: platform: fix build error with !CONFIG_PM_SLEEP
@ 2021-03-22 12:23 ` 'w00385741
  0 siblings, 0 replies; 4+ messages in thread
From: 'w00385741 @ 2021-03-22 12:23 UTC (permalink / raw)
  To: weiyongjun1, Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
	Jakub Kicinski, Maxime Coquelin, Philipp Zabel, Russell King,
	Joakim Zhang
  Cc: netdev, linux-stm32, linux-arm-kernel, kernel-janitors, Hulk Robot

From: Wei Yongjun <weiyongjun1@huawei.com>

Get rid of the CONFIG_PM_SLEEP ifdefery to fix the build error
and use __maybe_unused for the suspend()/resume() hooks to avoid
build warning:

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:769:21:
 error: 'stmmac_runtime_suspend' undeclared here (not in a function); did you mean 'stmmac_suspend'?
  769 |  SET_RUNTIME_PM_OPS(stmmac_runtime_suspend, stmmac_runtime_resume, NULL)
      |                     ^~~~~~~~~~~~~~~~~~~~~~
./include/linux/pm.h:342:21: note: in definition of macro 'SET_RUNTIME_PM_OPS'
  342 |  .runtime_suspend = suspend_fn, \
      |                     ^~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:769:45:
 error: 'stmmac_runtime_resume' undeclared here (not in a function)
  769 |  SET_RUNTIME_PM_OPS(stmmac_runtime_suspend, stmmac_runtime_resume, NULL)
      |                                             ^~~~~~~~~~~~~~~~~~~~~
./include/linux/pm.h:343:20: note: in definition of macro 'SET_RUNTIME_PM_OPS'
  343 |  .runtime_resume = resume_fn, \
      |                    ^~~~~~~~~

Fixes: 5ec55823438e ("net: stmmac: add clocks management for gmac driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 .../stmicro/stmmac/stmmac_platform.c       | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index a70b0bc84b2a..5a1e018884e6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -704,7 +704,6 @@ int stmmac_pltfr_remove(struct platform_device *pdev)
 }
 EXPORT_SYMBOL_GPL(stmmac_pltfr_remove);
 
-#ifdef CONFIG_PM_SLEEP
 /**
  * stmmac_pltfr_suspend
  * @dev: device pointer
@@ -712,7 +711,7 @@ EXPORT_SYMBOL_GPL(stmmac_pltfr_remove);
  * call the main suspend function and then, if required, on some platform, it
  * can call an exit helper.
  */
-static int stmmac_pltfr_suspend(struct device *dev)
+static int __maybe_unused stmmac_pltfr_suspend(struct device *dev)
 {
 	int ret;
 	struct net_device *ndev = dev_get_drvdata(dev);
@@ -733,7 +732,7 @@ static int stmmac_pltfr_suspend(struct device *dev)
  * the main resume function, on some platforms, it can call own init helper
  * if required.
  */
-static int stmmac_pltfr_resume(struct device *dev)
+static int __maybe_unused stmmac_pltfr_resume(struct device *dev)
 {
 	struct net_device *ndev = dev_get_drvdata(dev);
 	struct stmmac_priv *priv = netdev_priv(ndev);
@@ -745,7 +744,7 @@ static int stmmac_pltfr_resume(struct device *dev)
 	return stmmac_resume(dev);
 }
 
-static int stmmac_runtime_suspend(struct device *dev)
+static int __maybe_unused stmmac_runtime_suspend(struct device *dev)
 {
 	struct net_device *ndev = dev_get_drvdata(dev);
 	struct stmmac_priv *priv = netdev_priv(ndev);
@@ -755,14 +754,13 @@ static int stmmac_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int stmmac_runtime_resume(struct device *dev)
+static int __maybe_unused stmmac_runtime_resume(struct device *dev)
 {
 	struct net_device *ndev = dev_get_drvdata(dev);
 	struct stmmac_priv *priv = netdev_priv(ndev);
 
 	return stmmac_bus_clks_config(priv, true);
 }
-#endif /* CONFIG_PM_SLEEP */
 
 const struct dev_pm_ops stmmac_pltfr_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(stmmac_pltfr_suspend, stmmac_pltfr_resume)


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH net-next] net: stmmac: platform: fix build error with !CONFIG_PM_SLEEP
  2021-03-22 12:23 ` 'w00385741
@ 2021-03-22 20:40   ` patchwork-bot+netdevbpf
  -1 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-03-22 20:40 UTC (permalink / raw)
  To: 'w00385741
  Cc: peppe.cavallaro, alexandre.torgue, joabreu, kuba,
	mcoquelin.stm32, p.zabel, linux, qiangqing.zhang, netdev,
	linux-stm32, linux-arm-kernel, kernel-janitors, hulkci

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Mon, 22 Mar 2021 12:23:59 +0000 you wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Get rid of the CONFIG_PM_SLEEP ifdefery to fix the build error
> and use __maybe_unused for the suspend()/resume() hooks to avoid
> build warning:
> 
> drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:769:21:
>  error: 'stmmac_runtime_suspend' undeclared here (not in a function); did you mean 'stmmac_suspend'?
>   769 |  SET_RUNTIME_PM_OPS(stmmac_runtime_suspend, stmmac_runtime_resume, NULL)
>       |                     ^~~~~~~~~~~~~~~~~~~~~~
> ./include/linux/pm.h:342:21: note: in definition of macro 'SET_RUNTIME_PM_OPS'
>   342 |  .runtime_suspend = suspend_fn, \
>       |                     ^~~~~~~~~~
> drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:769:45:
>  error: 'stmmac_runtime_resume' undeclared here (not in a function)
>   769 |  SET_RUNTIME_PM_OPS(stmmac_runtime_suspend, stmmac_runtime_resume, NULL)
>       |                                             ^~~~~~~~~~~~~~~~~~~~~
> ./include/linux/pm.h:343:20: note: in definition of macro 'SET_RUNTIME_PM_OPS'
>   343 |  .runtime_resume = resume_fn, \
>       |                    ^~~~~~~~~
> 
> [...]

Here is the summary with links:
  - [net-next] net: stmmac: platform: fix build error with !CONFIG_PM_SLEEP
    https://git.kernel.org/netdev/net-next/c/7ec05a603548

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* Re: [PATCH net-next] net: stmmac: platform: fix build error with !CONFIG_PM_SLEEP
@ 2021-03-22 20:40   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-03-22 20:40 UTC (permalink / raw)
  To: 'w00385741
  Cc: peppe.cavallaro, alexandre.torgue, joabreu, kuba,
	mcoquelin.stm32, p.zabel, linux, qiangqing.zhang, netdev,
	linux-stm32, linux-arm-kernel, kernel-janitors, hulkci

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Mon, 22 Mar 2021 12:23:59 +0000 you wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Get rid of the CONFIG_PM_SLEEP ifdefery to fix the build error
> and use __maybe_unused for the suspend()/resume() hooks to avoid
> build warning:
> 
> drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:769:21:
>  error: 'stmmac_runtime_suspend' undeclared here (not in a function); did you mean 'stmmac_suspend'?
>   769 |  SET_RUNTIME_PM_OPS(stmmac_runtime_suspend, stmmac_runtime_resume, NULL)
>       |                     ^~~~~~~~~~~~~~~~~~~~~~
> ./include/linux/pm.h:342:21: note: in definition of macro 'SET_RUNTIME_PM_OPS'
>   342 |  .runtime_suspend = suspend_fn, \
>       |                     ^~~~~~~~~~
> drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:769:45:
>  error: 'stmmac_runtime_resume' undeclared here (not in a function)
>   769 |  SET_RUNTIME_PM_OPS(stmmac_runtime_suspend, stmmac_runtime_resume, NULL)
>       |                                             ^~~~~~~~~~~~~~~~~~~~~
> ./include/linux/pm.h:343:20: note: in definition of macro 'SET_RUNTIME_PM_OPS'
>   343 |  .runtime_resume = resume_fn, \
>       |                    ^~~~~~~~~
> 
> [...]

Here is the summary with links:
  - [net-next] net: stmmac: platform: fix build error with !CONFIG_PM_SLEEP
    https://git.kernel.org/netdev/net-next/c/7ec05a603548

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-03-22 20:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22 12:23 [PATCH net-next] net: stmmac: platform: fix build error with !CONFIG_PM_SLEEP 'w00385741
2021-03-22 12:23 ` 'w00385741
2021-03-22 20:40 ` patchwork-bot+netdevbpf
2021-03-22 20:40   ` patchwork-bot+netdevbpf

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.