* [PATCH] atl1: Protect atl1_suspend with CONFIG_PM_SLEEP
@ 2013-04-16 21:35 Fabio Estevam
2013-04-16 21:45 ` Sergei Shtylyov
2013-04-16 21:47 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Fabio Estevam @ 2013-04-16 21:35 UTC (permalink / raw)
To: davem; +Cc: netdev, joe, Fabio Estevam
From: Fabio Estevam <fabio.estevam@freescale.com>
commit 7b7a2bbb690 (atl1: Remove unneeded PM_OPS definitions) removed the
definition of atl1_suspend for the !CONFIG_PM_SLEEP case.
So only call atl1_suspend() when CONFIG_PM_SLEEP is defined and fix the
following build error from randconfig:
drivers/net/ethernet/atheros/atlx/atl1.c: In function 'atl1_shutdown':
drivers/net/ethernet/atheros/atlx/atl1.c:2888:2: error: implicit declaration of function 'atl1_suspend' [-Werror=implicit-function-declaration]
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
drivers/net/ethernet/atheros/atlx/atl1.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/atheros/atlx/atl1.c b/drivers/net/ethernet/atheros/atlx/atl1.c
index 9843c70..8338013 100644
--- a/drivers/net/ethernet/atheros/atlx/atl1.c
+++ b/drivers/net/ethernet/atheros/atlx/atl1.c
@@ -2885,7 +2885,9 @@ static void atl1_shutdown(struct pci_dev *pdev)
struct net_device *netdev = pci_get_drvdata(pdev);
struct atl1_adapter *adapter = netdev_priv(netdev);
+#ifdef CONFIG_PM_SLEEP
atl1_suspend(&pdev->dev);
+#endif
pci_wake_from_d3(pdev, adapter->wol);
pci_set_power_state(pdev, PCI_D3hot);
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] atl1: Protect atl1_suspend with CONFIG_PM_SLEEP
2013-04-16 21:35 [PATCH] atl1: Protect atl1_suspend with CONFIG_PM_SLEEP Fabio Estevam
@ 2013-04-16 21:45 ` Sergei Shtylyov
2013-04-16 21:47 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2013-04-16 21:45 UTC (permalink / raw)
To: Fabio Estevam; +Cc: davem, netdev, joe, Fabio Estevam
Hello.
On 04/17/2013 01:35 AM, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> commit 7b7a2bbb690 (atl1: Remove unneeded PM_OPS definitions) removed the
> definition of atl1_suspend for the !CONFIG_PM_SLEEP case.
>
> So only call atl1_suspend() when CONFIG_PM_SLEEP is defined and fix the
> following build error from randconfig:
>
> drivers/net/ethernet/atheros/atlx/atl1.c: In function 'atl1_shutdown':
> drivers/net/ethernet/atheros/atlx/atl1.c:2888:2: error: implicit declaration of function 'atl1_suspend' [-Werror=implicit-function-declaration]
>
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> drivers/net/ethernet/atheros/atlx/atl1.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/ethernet/atheros/atlx/atl1.c b/drivers/net/ethernet/atheros/atlx/atl1.c
> index 9843c70..8338013 100644
> --- a/drivers/net/ethernet/atheros/atlx/atl1.c
> +++ b/drivers/net/ethernet/atheros/atlx/atl1.c
> @@ -2885,7 +2885,9 @@ static void atl1_shutdown(struct pci_dev *pdev)
> struct net_device *netdev = pci_get_drvdata(pdev);
> struct atl1_adapter *adapter = netdev_priv(netdev);
>
> +#ifdef CONFIG_PM_SLEEP
> atl1_suspend(&pdev->dev);
> +#endif
This is not the best practice as #ifdef's in the function bodies are
not encouraged.
Better enclose
atl1_suspend() in #ifdef CONFIG_PM_SLEEP
and define it as an empty static inline function in the #else clause.
WBR, Sergei
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] atl1: Protect atl1_suspend with CONFIG_PM_SLEEP
2013-04-16 21:35 [PATCH] atl1: Protect atl1_suspend with CONFIG_PM_SLEEP Fabio Estevam
2013-04-16 21:45 ` Sergei Shtylyov
@ 2013-04-16 21:47 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2013-04-16 21:47 UTC (permalink / raw)
To: festevam; +Cc: netdev, joe, fabio.estevam
From: Fabio Estevam <festevam@gmail.com>
Date: Tue, 16 Apr 2013 18:35:00 -0300
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> commit 7b7a2bbb690 (atl1: Remove unneeded PM_OPS definitions) removed the
> definition of atl1_suspend for the !CONFIG_PM_SLEEP case.
>
> So only call atl1_suspend() when CONFIG_PM_SLEEP is defined and fix the
> following build error from randconfig:
>
> drivers/net/ethernet/atheros/atlx/atl1.c: In function 'atl1_shutdown':
> drivers/net/ethernet/atheros/atlx/atl1.c:2888:2: error: implicit declaration of function 'atl1_suspend' [-Werror=implicit-function-declaration]
>
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-16 21:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-16 21:35 [PATCH] atl1: Protect atl1_suspend with CONFIG_PM_SLEEP Fabio Estevam
2013-04-16 21:45 ` Sergei Shtylyov
2013-04-16 21:47 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox