linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] usb: cdns3: imx: mark cdns_imx_resume as __maybe_unused
@ 2021-03-09 13:14 'Wei Yongjun
  2021-03-09 15:26 ` Sergei Shtylyov
  0 siblings, 1 reply; 3+ messages in thread
From: 'Wei Yongjun @ 2021-03-09 13:14 UTC (permalink / raw)
  To: weiyongjun1, Peter Chen, Pawel Laszczak, Greg Kroah-Hartman,
	Shawn Guo, Sascha Hauer, Frank Li
  Cc: linux-usb, linux-arm-kernel, kernel-janitors, Hulk Robot

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(-)

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);
 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] usb: cdns3: imx: mark cdns_imx_resume as __maybe_unused
  2021-03-09 13:14 [PATCH -next] usb: cdns3: imx: mark cdns_imx_resume as __maybe_unused 'Wei Yongjun
@ 2021-03-09 15:26 ` Sergei Shtylyov
  2021-03-09 15:47   ` weiyongjun (A)
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2021-03-09 15:26 UTC (permalink / raw)
  To: 'Wei Yongjun, Peter Chen, Pawel Laszczak, Greg Kroah-Hartman,
	Shawn Guo, Sascha Hauer, Frank Li
  Cc: linux-usb, linux-arm-kernel, kernel-janitors, Hulk Robot

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] usb: cdns3: imx: mark cdns_imx_resume as __maybe_unused
  2021-03-09 15:26 ` Sergei Shtylyov
@ 2021-03-09 15:47   ` weiyongjun (A)
  0 siblings, 0 replies; 3+ messages in thread
From: weiyongjun (A) @ 2021-03-09 15:47 UTC (permalink / raw)
  To: Sergei Shtylyov, Peter Chen, Pawel Laszczak, Greg Kroah-Hartman,
	Shawn Guo, Sascha Hauer, Frank Li
  Cc: linux-usb, linux-arm-kernel, kernel-janitors, Hulk Robot


> 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.



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-09 15:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-09 13:14 [PATCH -next] usb: cdns3: imx: mark cdns_imx_resume as __maybe_unused 'Wei Yongjun
2021-03-09 15:26 ` Sergei Shtylyov
2021-03-09 15:47   ` weiyongjun (A)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).