netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers/net: fix build warnings with CONFIG_PM_SLEEP disabled
@ 2011-03-07  2:14 Michel Lespinasse
  2011-03-07 23:07 ` Stephen Hemminger
  2011-03-14 21:26 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Michel Lespinasse @ 2011-03-07  2:14 UTC (permalink / raw)
  To: Stephen Hemminger, David S. Miller, netdev
  Cc: Andrew Morton, Linus Torvalds, linux-kernel

This fixes a couple of build warnings when CONFIG_PM is enabled but
CONFIG_PM_SLEEP is disabled. Applies on top of v2.6.38-rc7 - I know it's
late, but it would be great if v2.6.38 could compile without warnings!

Signed-off-by: Michel Lespinasse <walken@google.com>
---
 drivers/net/forcedeth.c |    8 ++++++--
 drivers/net/sky2.c      |    2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 9c0b1ba..7b92897 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -5744,7 +5744,7 @@ static void __devexit nv_remove(struct pci_dev *pci_dev)
 	pci_set_drvdata(pci_dev, NULL);
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int nv_suspend(struct device *device)
 {
 	struct pci_dev *pdev = to_pci_dev(device);
@@ -5795,6 +5795,11 @@ static int nv_resume(struct device *device)
 static SIMPLE_DEV_PM_OPS(nv_pm_ops, nv_suspend, nv_resume);
 #define NV_PM_OPS (&nv_pm_ops)
 
+#else
+#define NV_PM_OPS NULL
+#endif /* CONFIG_PM_SLEEP */
+
+#ifdef CONFIG_PM
 static void nv_shutdown(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
@@ -5822,7 +5827,6 @@ static void nv_shutdown(struct pci_dev *pdev)
 	}
 }
 #else
-#define NV_PM_OPS NULL
 #define nv_shutdown NULL
 #endif /* CONFIG_PM */
 
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 7d85a38..2a91868 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -4983,7 +4983,7 @@ static int sky2_suspend(struct device *dev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int sky2_resume(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);

-- 
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.

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

* Re: [PATCH] drivers/net: fix build warnings with CONFIG_PM_SLEEP disabled
  2011-03-07  2:14 [PATCH] drivers/net: fix build warnings with CONFIG_PM_SLEEP disabled Michel Lespinasse
@ 2011-03-07 23:07 ` Stephen Hemminger
  2011-03-08  0:02   ` Michel Lespinasse
  2011-03-14 21:26 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2011-03-07 23:07 UTC (permalink / raw)
  To: Michel Lespinasse
  Cc: David S. Miller, netdev, Andrew Morton, Linus Torvalds,
	linux-kernel

On Sun, 6 Mar 2011 18:14:50 -0800
Michel Lespinasse <walken@google.com> wrote:

> This fixes a couple of build warnings when CONFIG_PM is enabled but
> CONFIG_PM_SLEEP is disabled. Applies on top of v2.6.38-rc7 - I know it's
> late, but it would be great if v2.6.38 could compile without warnings!
> 
> Signed-off-by: Michel Lespinasse <walken@google.com>

This is standard throughout all the network drivers.
Why just fix 2?


-- 

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

* Re: [PATCH] drivers/net: fix build warnings with CONFIG_PM_SLEEP disabled
  2011-03-07 23:07 ` Stephen Hemminger
@ 2011-03-08  0:02   ` Michel Lespinasse
  0 siblings, 0 replies; 4+ messages in thread
From: Michel Lespinasse @ 2011-03-08  0:02 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: David S. Miller, netdev, Andrew Morton, Linus Torvalds,
	linux-kernel

On Mon, Mar 7, 2011 at 3:07 PM, Stephen Hemminger
<shemminger@linux-foundation.org> wrote:
> On Sun, 6 Mar 2011 18:14:50 -0800
> Michel Lespinasse <walken@google.com> wrote:
>
>> This fixes a couple of build warnings when CONFIG_PM is enabled but
>> CONFIG_PM_SLEEP is disabled. Applies on top of v2.6.38-rc7 - I know it's
>> late, but it would be great if v2.6.38 could compile without warnings!
>>
>> Signed-off-by: Michel Lespinasse <walken@google.com>
>
> This is standard throughout all the network drivers.
> Why just fix 2?

I only looked at the build warnings we get with our local config.
Some drivers do get this right, such as tg3 for example.

Having a quick look at other SIMPLE_DEV_PM_OPS users, it seems at
least drivers/net/skge.c does have the same issue though.

-- 
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.

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

* Re: [PATCH] drivers/net: fix build warnings with CONFIG_PM_SLEEP disabled
  2011-03-07  2:14 [PATCH] drivers/net: fix build warnings with CONFIG_PM_SLEEP disabled Michel Lespinasse
  2011-03-07 23:07 ` Stephen Hemminger
@ 2011-03-14 21:26 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2011-03-14 21:26 UTC (permalink / raw)
  To: walken; +Cc: shemminger, netdev, akpm, torvalds, linux-kernel

From: Michel Lespinasse <walken@google.com>
Date: Sun, 6 Mar 2011 18:14:50 -0800

> This fixes a couple of build warnings when CONFIG_PM is enabled but
> CONFIG_PM_SLEEP is disabled. Applies on top of v2.6.38-rc7 - I know it's
> late, but it would be great if v2.6.38 could compile without warnings!
> 
> Signed-off-by: Michel Lespinasse <walken@google.com>

I know it'd "be great" if this went into 2.6.38 but it doesn't fix
any real bugs, so I'm putting it into net-next-2.6

Thanks.

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

end of thread, other threads:[~2011-03-14 21:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-07  2:14 [PATCH] drivers/net: fix build warnings with CONFIG_PM_SLEEP disabled Michel Lespinasse
2011-03-07 23:07 ` Stephen Hemminger
2011-03-08  0:02   ` Michel Lespinasse
2011-03-14 21:26 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).