Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@linux.intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH] igb: fix unused igb_deliver_wake_packet() warning when CONFIG_PM=n
Date: Wed, 12 Jul 2017 14:09:25 -0700	[thread overview]
Message-ID: <20170712210925.4F647FAA@viggo.jf.intel.com> (raw)


From: Dave Hansen <dave.hansen@linux.intel.com>

I'm seeing warnings on kernel configurations where CONFIG_PM is
disabled.  It happens in 4.12, at least:

drivers/ethernet/intel/igb/igb_main.c:7988:13: warning: 'igb_deliver_wake_packet' defined but not used [-Wunused-function]

This is because igb_deliver_wake_packet() is defined outside of
the #ifdef", but is used only a single time within the #ifdef in
igb_resume().  Fix it by moving igb_deliver_wake_packet() next to
igb_resume() inside the #ifdef.

The diff ends up looking a bit funky here.  It *looks* like
igb_suspend() is getting moved, but that's an artifact of how
'diff' sees the changes.

Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
---

 b/drivers/net/ethernet/intel/igb/igb_main.c |   46 ++++++++++++++--------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff -puN drivers/net/ethernet/intel/igb/igb_main.c~undef-igb_deliver_wake_packet drivers/net/ethernet/intel/igb/igb_main.c
--- a/drivers/net/ethernet/intel/igb/igb_main.c~undef-igb_deliver_wake_packet	2017-07-12 14:08:37.205721093 -0700
+++ b/drivers/net/ethernet/intel/igb/igb_main.c	2017-07-12 14:08:37.210721093 -0700
@@ -7985,6 +7985,29 @@ static int __igb_shutdown(struct pci_dev
 	return 0;
 }
 
+#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
+static int igb_suspend(struct device *dev)
+{
+	int retval;
+	bool wake;
+	struct pci_dev *pdev = to_pci_dev(dev);
+
+	retval = __igb_shutdown(pdev, &wake, 0);
+	if (retval)
+		return retval;
+
+	if (wake) {
+		pci_prepare_to_sleep(pdev);
+	} else {
+		pci_wake_from_d3(pdev, false);
+		pci_set_power_state(pdev, PCI_D3hot);
+	}
+
+	return 0;
+}
+#endif /* CONFIG_PM_SLEEP */
+
 static void igb_deliver_wake_packet(struct net_device *netdev)
 {
 	struct igb_adapter *adapter = netdev_priv(netdev);
@@ -8015,29 +8038,6 @@ static void igb_deliver_wake_packet(stru
 	netif_rx(skb);
 }
 
-#ifdef CONFIG_PM
-#ifdef CONFIG_PM_SLEEP
-static int igb_suspend(struct device *dev)
-{
-	int retval;
-	bool wake;
-	struct pci_dev *pdev = to_pci_dev(dev);
-
-	retval = __igb_shutdown(pdev, &wake, 0);
-	if (retval)
-		return retval;
-
-	if (wake) {
-		pci_prepare_to_sleep(pdev);
-	} else {
-		pci_wake_from_d3(pdev, false);
-		pci_set_power_state(pdev, PCI_D3hot);
-	}
-
-	return 0;
-}
-#endif /* CONFIG_PM_SLEEP */
-
 static int igb_resume(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
_

             reply	other threads:[~2017-07-12 21:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-12 21:09 Dave Hansen [this message]
2017-07-12 21:23 ` [Intel-wired-lan] [PATCH] igb: fix unused igb_deliver_wake_packet() warning when CONFIG_PM=n Fabio Estevam
2017-07-13 22:33   ` Jeff Kirsher
2017-07-12 21:37 ` 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=20170712210925.4F647FAA@viggo.jf.intel.com \
    --to=dave.hansen@linux.intel.com \
    --cc=intel-wired-lan@osuosl.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