Skip to content

Commit

Permalink
pcnet32: Mark PM functions as __maybe_unused
Browse files Browse the repository at this point in the history
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: a86688f ("pcnet32: Convert to generic power management")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nathan Chancellor authored and David S. Miller committed Jul 1, 2020
1 parent 0adcd29 commit 75603a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/amd/pcnet32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand Down

0 comments on commit 75603a3

Please sign in to comment.