From: Dave Jones <davej@redhat.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [1/4 v2] Remove unused zero-copy code from velocity NIC driver.
Date: Thu, 23 Jul 2009 20:44:49 -0400 [thread overview]
Message-ID: <20090724004449.GA16422@redhat.com> (raw)
In-Reply-To: <20090723.155855.108555685.davem@davemloft.net>
On Thu, Jul 23, 2009 at 03:58:55PM -0700, David Miller wrote:
> From: David Miller <davem@davemloft.net>
> Date: Tue, 21 Jul 2009 12:33:22 -0700 (PDT)
>
> > Ok, all applied to net-next-2.6, thanks.
>
> Ok, now we have a stinking pile of poo situation when one tries to
> compile the velocity driver without CONFIG_PM defined.
>
> First we hit:
>
> drivers/net/via-velocity.c: In function ‘velocity_init_module’:
> drivers/net/via-velocity.c:3303: error: implicit declaration of function ‘velocity_register_notifier’
> drivers/net/via-velocity.c:3306: error: implicit declaration of function ‘velocity_unregister_notifier’
>
> Because the whole CONFIG_PM + CONFIG_INET ifdeffery around these functions
> was missed up. Simple enough to fix, but then we get:
>
> drivers/net/via-velocity.c:2957: warning: ‘velocity_suspend’ defined but not used
> drivers/net/via-velocity.c:3026: warning: ‘velocity_resume’ defined but not used
>
> Fine, let's ifdef protect these two functions with CONFIG_PM:
>
> drivers/net/via-velocity.c:2853: warning: ‘velocity_set_wol’ defined but not used
> drivers/net/via-velocity.c:2939: warning: ‘velocity_save_context’ defined but not used
> drivers/net/via-velocity.c:3001: warning: ‘velocity_restore_context’ defined but not used
>
> And at this point I really give up Dave. This whole thing to move
> functions around to avoid forward decls has created a worse problem
> than it solved.
>
> Unless you can fix this, like, immediately. I want to revert.
>
> This is keeping me from pulling more work into my net-next-2.6
> tree.
apologies.. This should fix it..
Dave
--
Previous changes broke compilation with CONFIG_PM disabled.
This widens the ifdefs to cover the functions that only get called
within the suspend/resume routines.
Signed-off-by: Dave Jones <davej@redhat.com>
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index b4bd1d3..47be41a 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -2805,6 +2805,7 @@ err_free_dev:
}
+#ifdef CONFIG_PM
/**
* wol_calc_crc - WOL CRC
* @pattern: data pattern
@@ -2952,7 +2953,6 @@ static void velocity_save_context(struct velocity_info *vptr, struct velocity_co
}
-
static int velocity_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct net_device *dev = pci_get_drvdata(pdev);
@@ -3056,7 +3056,7 @@ static int velocity_resume(struct pci_dev *pdev)
return 0;
}
-
+#endif
/*
* Definition for our device driver. The PCI layer interface
@@ -3239,7 +3239,6 @@ static const struct ethtool_ops velocity_ethtool_ops = {
};
#ifdef CONFIG_PM
-
#ifdef CONFIG_INET
static int velocity_netdev_event(struct notifier_block *nb, unsigned long notification, void *ptr)
{
@@ -3263,6 +3262,7 @@ static int velocity_netdev_event(struct notifier_block *nb, unsigned long notifi
return NOTIFY_DONE;
}
#endif /* CONFIG_INET */
+#endif /* CONFIG_PM */
#if defined(CONFIG_PM) && defined(CONFIG_INET)
static struct notifier_block velocity_inetaddr_notifier = {
@@ -3286,8 +3286,6 @@ static void velocity_unregister_notifier(void)
#endif /* defined(CONFIG_PM) && defined(CONFIG_INET) */
-#endif /* CONFIG_PM */
-
/**
* velocity_init_module - load time function
*
next prev parent reply other threads:[~2009-07-24 0:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-21 19:28 [1/4 v2] Remove unused zero-copy code from velocity NIC driver Dave Jones
2009-07-21 19:32 ` David Miller
2009-07-21 19:32 ` David Miller
2009-07-21 19:33 ` David Miller
2009-07-21 19:44 ` Dave Jones
2009-07-23 22:58 ` David Miller
2009-07-24 0:44 ` Dave Jones [this message]
2009-07-24 2:02 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090724004449.GA16422@redhat.com \
--to=davej@redhat.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).