diff mbox series

[-next] usb: cdns3: imx: mark cdns_imx_resume as __maybe_unused

Message ID 20210309131457.1884112-1-weiyongjun1@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] usb: cdns3: imx: mark cdns_imx_resume as __maybe_unused | expand

Commit Message

Wei Yongjun March 9, 2021, 1:14 p.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

The function cdns_imx_resume() may have no callers depending
on configuration, so it must be marked __maybe_unused to avoid
harmless warning:

drivers/usb/cdns3/cdns3-imx.c:378:12: warning:
 'cdns_imx_system_resume' defined but not used [-Wunused-function]
  378 | static int cdns_imx_system_resume(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~

Fixes: 67982dfa59de ("usb: cdns3: imx: add power lost support for system resume")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/usb/cdns3/cdns3-imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sergey Shtylyov March 9, 2021, 3:26 p.m. UTC | #1
Hello!

On 3/9/21 4:14 PM, 'Wei Yongjun wrote:

> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> The function cdns_imx_resume() may have no callers depending
> on configuration, so it must be marked __maybe_unused to avoid
> harmless warning:
> 
> drivers/usb/cdns3/cdns3-imx.c:378:12: warning:
>  'cdns_imx_system_resume' defined but not used [-Wunused-function]
>   378 | static int cdns_imx_system_resume(struct device *dev)
>       |            ^~~~~~~~~~~~~~~~~~

   Looks like that warning was copied from another kernel, where this function
was named differently?

> 
> Fixes: 67982dfa59de ("usb: cdns3: imx: add power lost support for system resume")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/usb/cdns3/cdns3-imx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/cdns3/cdns3-imx.c b/drivers/usb/cdns3/cdns3-imx.c
> index 708b51cc5844..96fff823a594 100644
> --- a/drivers/usb/cdns3/cdns3-imx.c
> +++ b/drivers/usb/cdns3/cdns3-imx.c
> @@ -346,7 +346,7 @@ static int cdns_imx_platform_suspend(struct device *dev,
>  
>  }
>  
> -static int cdns_imx_resume(struct device *dev)
> +static int __maybe_unused cdns_imx_resume(struct device *dev)
>  {
>  	struct cdns_imx *data = dev_get_drvdata(dev);
>  

MBR, Sergei
Wei Yongjun March 9, 2021, 3:47 p.m. UTC | #2
> Hello!
>
> On 3/9/21 4:14 PM, 'Wei Yongjun wrote:
>
>> From: Wei Yongjun <weiyongjun1@huawei.com>
>>
>> The function cdns_imx_resume() may have no callers depending
>> on configuration, so it must be marked __maybe_unused to avoid
>> harmless warning:
>>
>> drivers/usb/cdns3/cdns3-imx.c:378:12: warning:
>>   'cdns_imx_system_resume' defined but not used [-Wunused-function]
>>    378 | static int cdns_imx_system_resume(struct device *dev)
>>        |            ^~~~~~~~~~~~~~~~~~
>     Looks like that warning was copied from another kernel, where this function
> was named differently?


Sorry, it seems I post the wrong patch. I will send v2. Thanks.
diff mbox series

Patch

diff --git a/drivers/usb/cdns3/cdns3-imx.c b/drivers/usb/cdns3/cdns3-imx.c
index 708b51cc5844..96fff823a594 100644
--- a/drivers/usb/cdns3/cdns3-imx.c
+++ b/drivers/usb/cdns3/cdns3-imx.c
@@ -346,7 +346,7 @@  static int cdns_imx_platform_suspend(struct device *dev,
 
 }
 
-static int cdns_imx_resume(struct device *dev)
+static int __maybe_unused cdns_imx_resume(struct device *dev)
 {
 	struct cdns_imx *data = dev_get_drvdata(dev);