[net-next] ksz884x: mark pcidev_suspend() as __maybe_unused
diff mbox series

Message ID 20200702091810.4999-1-weiyongjun1@huawei.com
State New
Headers show
Series
  • [net-next] ksz884x: mark pcidev_suspend() as __maybe_unused
Related show

Commit Message

Wei Yongjun July 2, 2020, 9:18 a.m. UTC
In certain configurations without power management support, gcc report
the following warning:

drivers/net/ethernet/micrel/ksz884x.c:7182:12: warning:
 'pcidev_suspend' defined but not used [-Wunused-function]
 7182 | static int pcidev_suspend(struct device *dev_d)
      |            ^~~~~~~~~~~~~~

Mark pcidev_suspend() as __maybe_unused to make it clear.

Fixes: 64120615d140 ("ksz884x: use generic power management")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/net/ethernet/micrel/ksz884x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Vaibhav Gupta July 2, 2020, 10:18 a.m. UTC | #1
On Thu, Jul 2, 2020 at 2:38 PM Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> In certain configurations without power management support, gcc report
> the following warning:
>
> drivers/net/ethernet/micrel/ksz884x.c:7182:12: warning:
>  'pcidev_suspend' defined but not used [-Wunused-function]
>  7182 | static int pcidev_suspend(struct device *dev_d)
>       |            ^~~~~~~~~~~~~~
>
> Mark pcidev_suspend() as __maybe_unused to make it clear.
>
> Fixes: 64120615d140 ("ksz884x: use generic power management")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/net/ethernet/micrel/ksz884x.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c
> index 24901342ecc0..2ce7304d3753 100644
> --- a/drivers/net/ethernet/micrel/ksz884x.c
> +++ b/drivers/net/ethernet/micrel/ksz884x.c
> @@ -7179,7 +7179,7 @@ static int __maybe_unused pcidev_resume(struct device *dev_d)
>         return 0;
>  }
>
> -static int pcidev_suspend(struct device *dev_d)
> +static int __maybe_unused pcidev_suspend(struct device *dev_d)
>  {
>         int i;
>         struct platform_info *info = dev_get_drvdata(dev_d);
>
This is a necessary fix. Thanks !
--Vaibhav Gupta

Patch
diff mbox series

diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c
index 24901342ecc0..2ce7304d3753 100644
--- a/drivers/net/ethernet/micrel/ksz884x.c
+++ b/drivers/net/ethernet/micrel/ksz884x.c
@@ -7179,7 +7179,7 @@  static int __maybe_unused pcidev_resume(struct device *dev_d)
 	return 0;
 }
 
-static int pcidev_suspend(struct device *dev_d)
+static int __maybe_unused pcidev_suspend(struct device *dev_d)
 {
 	int i;
 	struct platform_info *info = dev_get_drvdata(dev_d);