]> git.baikalelectronics.ru Git - kernel.git/commit
mlx4: Mark PM functions as __maybe_unused
authorWei Yongjun <weiyongjun1@huawei.com>
Thu, 2 Jul 2020 09:19:46 +0000 (17:19 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 2 Jul 2020 21:24:17 +0000 (14:24 -0700)
commit89b8fb6c2aa3ab3df238d9b265047192545a2081
tree8339aed40834ab14fb58f5eb32ced413efb08221
parent050043a2680a29462a0c9a42a549b3b9d2f2a585
mlx4: Mark PM functions as __maybe_unused

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

drivers/net/ethernet/mellanox/mlx4/main.c:4388:12:
 warning: 'mlx4_resume' defined but not used [-Wunused-function]
 4388 | static int mlx4_resume(struct device *dev_d)
      |            ^~~~~~~~~~~
drivers/net/ethernet/mellanox/mlx4/main.c:4373:12: warning:
 'mlx4_suspend' defined but not used [-Wunused-function]
 4373 | static int mlx4_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: 416ccced4858 ("mlx4: use generic power management")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/main.c