Skip to content

Commit

Permalink
amd8111e: 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/amd8111e.c:1623:12: warning:
'amd8111e_resume' defined but not used [-Wunused-function]
 1623 | static int amd8111e_resume(struct device *dev_d)
      |            ^~~~~~~~~~~~~~~
../drivers/net/ethernet/amd/amd8111e.c:1584:12: warning:
'amd8111e_suspend' defined but not used [-Wunused-function]
 1584 | static int amd8111e_suspend(struct device *dev_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: 2caf751 ("amd8111e: 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 2429ec2 commit 0adcd29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/amd/amd8111e.c
Original file line number Diff line number Diff line change
Expand Up @@ -1581,7 +1581,7 @@ static void amd8111e_tx_timeout(struct net_device *dev, unsigned int txqueue)
netif_wake_queue(dev);
}

static int amd8111e_suspend(struct device *dev_d)
static int __maybe_unused amd8111e_suspend(struct device *dev_d)
{
struct net_device *dev = dev_get_drvdata(dev_d);
struct amd8111e_priv *lp = netdev_priv(dev);
Expand Down Expand Up @@ -1620,7 +1620,7 @@ static int amd8111e_suspend(struct device *dev_d)
return 0;
}

static int amd8111e_resume(struct device *dev_d)
static int __maybe_unused amd8111e_resume(struct device *dev_d)
{
struct net_device *dev = dev_get_drvdata(dev_d);
struct amd8111e_priv *lp = netdev_priv(dev);
Expand Down

0 comments on commit 0adcd29

Please sign in to comment.