linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <natechancellor@gmail.com>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: Vaibhav Gupta <vaibhavgupta40@gmail.com>,
	Don Fry <pcnet32@frontier.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Nathan Chancellor <natechancellor@gmail.com>
Subject: [PATCH net-next 2/2] pcnet32: Mark PM functions as __maybe_unused
Date: Tue, 30 Jun 2020 14:00:34 -0700	[thread overview]
Message-ID: <20200630210034.3624587-2-natechancellor@gmail.com> (raw)
In-Reply-To: <20200630210034.3624587-1-natechancellor@gmail.com>

In certain configurations without power management support, the
following warnings happen:

../drivers/net/ethernet/amd/pcnet32.c:2928:12: warning:
'pcnet32_pm_resume' defined but not used [-Wunused-function]
 2928 | static int pcnet32_pm_resume(struct device *device_d)
      |            ^~~~~~~~~~~~~~~~~
../drivers/net/ethernet/amd/pcnet32.c:2916:12: warning:
'pcnet32_pm_suspend' defined but not used [-Wunused-function]
 2916 | static int pcnet32_pm_suspend(struct device *device_d)
      |            ^~~~~~~~~~~~~~~~~~

Mark these functions as __maybe_unused to make it clear to the compiler
that this is going to happen based on the configuration, which is the
standard for these types of functions.

Fixes: a86688fbef1b ("pcnet32: Convert to generic power management")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
 drivers/net/ethernet/amd/pcnet32.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c
index d32f54d760e7..f47140391f67 100644
--- a/drivers/net/ethernet/amd/pcnet32.c
+++ b/drivers/net/ethernet/amd/pcnet32.c
@@ -2913,7 +2913,7 @@ static void pcnet32_watchdog(struct timer_list *t)
 	mod_timer(&lp->watchdog_timer, round_jiffies(PCNET32_WATCHDOG_TIMEOUT));
 }
 
-static int pcnet32_pm_suspend(struct device *device_d)
+static int __maybe_unused pcnet32_pm_suspend(struct device *device_d)
 {
 	struct net_device *dev = dev_get_drvdata(device_d);
 
@@ -2925,7 +2925,7 @@ static int pcnet32_pm_suspend(struct device *device_d)
 	return 0;
 }
 
-static int pcnet32_pm_resume(struct device *device_d)
+static int __maybe_unused pcnet32_pm_resume(struct device *device_d)
 {
 	struct net_device *dev = dev_get_drvdata(device_d);
 
-- 
2.27.0


  reply	other threads:[~2020-06-30 21:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-30 21:00 [PATCH net-next 1/2] amd8111e: " Nathan Chancellor
2020-06-30 21:00 ` Nathan Chancellor [this message]
2020-07-01  1:18   ` [PATCH net-next 2/2] pcnet32: " David Miller
2020-07-01  1:18 ` [PATCH net-next 1/2] amd8111e: " 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=20200630210034.3624587-2-natechancellor@gmail.com \
    --to=natechancellor@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pcnet32@frontier.com \
    --cc=vaibhavgupta40@gmail.com \
    --subject='Re: [PATCH net-next 2/2] pcnet32: Mark PM functions as __maybe_unused' \
    /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

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox