diff mbox series

[-next] media: marvell-ccic: Fix -Wunused-function warnings

Message ID 20200910080933.40684-1-yuehaibing@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] media: marvell-ccic: Fix -Wunused-function warnings | expand

Commit Message

Yue Haibing Sept. 10, 2020, 8:09 a.m. UTC
If CONFIG_PM is n, gcc warns:

drivers/media/platform/marvell-ccic/mmp-driver.c:347:12: warning: ‘mmpcam_resume’ defined but not used [-Wunused-function]
 static int mmpcam_resume(struct device *dev)
            ^~~~~~~~~~~~~
drivers/media/platform/marvell-ccic/mmp-driver.c:338:12: warning: ‘mmpcam_suspend’ defined but not used [-Wunused-function]
 static int mmpcam_suspend(struct device *dev)
            ^~~~~~~~~~~~~~
drivers/media/platform/marvell-ccic/mmp-driver.c:324:12: warning: ‘mmpcam_runtime_suspend’ defined but not used [-Wunused-function]
 static int mmpcam_runtime_suspend(struct device *dev)
            ^~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/marvell-ccic/mmp-driver.c:310:12: warning: ‘mmpcam_runtime_resume’ defined but not used [-Wunused-function]
 static int mmpcam_runtime_resume(struct device *dev)
            ^~~~~~~~~~~~~~~~~~~~~

Mark them as __maybe_unused to fix this.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/media/platform/marvell-ccic/mmp-driver.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Lubomir Rintel Sept. 10, 2020, 8:22 a.m. UTC | #1
On Thu, Sep 10, 2020 at 04:09:33PM +0800, YueHaibing wrote:
> If CONFIG_PM is n, gcc warns:
> 
> drivers/media/platform/marvell-ccic/mmp-driver.c:347:12: warning: ‘mmpcam_resume’ defined but not used [-Wunused-function]
>  static int mmpcam_resume(struct device *dev)
>             ^~~~~~~~~~~~~
> drivers/media/platform/marvell-ccic/mmp-driver.c:338:12: warning: ‘mmpcam_suspend’ defined but not used [-Wunused-function]
>  static int mmpcam_suspend(struct device *dev)
>             ^~~~~~~~~~~~~~
> drivers/media/platform/marvell-ccic/mmp-driver.c:324:12: warning: ‘mmpcam_runtime_suspend’ defined but not used [-Wunused-function]
>  static int mmpcam_runtime_suspend(struct device *dev)
>             ^~~~~~~~~~~~~~~~~~~~~~
> drivers/media/platform/marvell-ccic/mmp-driver.c:310:12: warning: ‘mmpcam_runtime_resume’ defined but not used [-Wunused-function]
>  static int mmpcam_runtime_resume(struct device *dev)
>             ^~~~~~~~~~~~~~~~~~~~~
> 
> Mark them as __maybe_unused to fix this.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Your colleague seems to sent out an equivalent patch:
https://lore.kernel.org/lkml/20200910080933.40684-1-yuehaibing@huawei.com/

Cheers
Lubo

> ---
>  drivers/media/platform/marvell-ccic/mmp-driver.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/platform/marvell-ccic/mmp-driver.c b/drivers/media/platform/marvell-ccic/mmp-driver.c
> index c4b28a00a3a2..032fdddbbecc 100644
> --- a/drivers/media/platform/marvell-ccic/mmp-driver.c
> +++ b/drivers/media/platform/marvell-ccic/mmp-driver.c
> @@ -307,7 +307,7 @@ static int mmpcam_platform_remove(struct platform_device *pdev)
>   * Suspend/resume support.
>   */
>  
> -static int mmpcam_runtime_resume(struct device *dev)
> +static int __maybe_unused mmpcam_runtime_resume(struct device *dev)
>  {
>  	struct mmp_camera *cam = dev_get_drvdata(dev);
>  	struct mcam_camera *mcam = &cam->mcam;
> @@ -321,7 +321,7 @@ static int mmpcam_runtime_resume(struct device *dev)
>  	return 0;
>  }
>  
> -static int mmpcam_runtime_suspend(struct device *dev)
> +static int __maybe_unused mmpcam_runtime_suspend(struct device *dev)
>  {
>  	struct mmp_camera *cam = dev_get_drvdata(dev);
>  	struct mcam_camera *mcam = &cam->mcam;
> @@ -335,7 +335,7 @@ static int mmpcam_runtime_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int mmpcam_suspend(struct device *dev)
> +static int __maybe_unused mmpcam_suspend(struct device *dev)
>  {
>  	struct mmp_camera *cam = dev_get_drvdata(dev);
>  
> @@ -344,7 +344,7 @@ static int mmpcam_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int mmpcam_resume(struct device *dev)
> +static int __maybe_unused mmpcam_resume(struct device *dev)
>  {
>  	struct mmp_camera *cam = dev_get_drvdata(dev);
>  
> -- 
> 2.17.1
> 
>
Yue Haibing Sept. 10, 2020, 9:18 a.m. UTC | #2
On 2020/9/10 16:22, Lubomir Rintel wrote:
> On Thu, Sep 10, 2020 at 04:09:33PM +0800, YueHaibing wrote:
>> If CONFIG_PM is n, gcc warns:
>>
>> drivers/media/platform/marvell-ccic/mmp-driver.c:347:12: warning: ‘mmpcam_resume’ defined but not used [-Wunused-function]
>>  static int mmpcam_resume(struct device *dev)
>>             ^~~~~~~~~~~~~
>> drivers/media/platform/marvell-ccic/mmp-driver.c:338:12: warning: ‘mmpcam_suspend’ defined but not used [-Wunused-function]
>>  static int mmpcam_suspend(struct device *dev)
>>             ^~~~~~~~~~~~~~
>> drivers/media/platform/marvell-ccic/mmp-driver.c:324:12: warning: ‘mmpcam_runtime_suspend’ defined but not used [-Wunused-function]
>>  static int mmpcam_runtime_suspend(struct device *dev)
>>             ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/marvell-ccic/mmp-driver.c:310:12: warning: ‘mmpcam_runtime_resume’ defined but not used [-Wunused-function]
>>  static int mmpcam_runtime_resume(struct device *dev)
>>             ^~~~~~~~~~~~~~~~~~~~~
>>
>> Mark them as __maybe_unused to fix this.
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> 
> Your colleague seems to sent out an equivalent patch:
> https://lore.kernel.org/lkml/20200910080933.40684-1-yuehaibing@huawei.com/

This is my patch, paste an wrong link?

> 
> Cheers
> Lubo
> 
>> ---
>>  drivers/media/platform/marvell-ccic/mmp-driver.c | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/media/platform/marvell-ccic/mmp-driver.c b/drivers/media/platform/marvell-ccic/mmp-driver.c
>> index c4b28a00a3a2..032fdddbbecc 100644
>> --- a/drivers/media/platform/marvell-ccic/mmp-driver.c
>> +++ b/drivers/media/platform/marvell-ccic/mmp-driver.c
>> @@ -307,7 +307,7 @@ static int mmpcam_platform_remove(struct platform_device *pdev)
>>   * Suspend/resume support.
>>   */
>>  
>> -static int mmpcam_runtime_resume(struct device *dev)
>> +static int __maybe_unused mmpcam_runtime_resume(struct device *dev)
>>  {
>>  	struct mmp_camera *cam = dev_get_drvdata(dev);
>>  	struct mcam_camera *mcam = &cam->mcam;
>> @@ -321,7 +321,7 @@ static int mmpcam_runtime_resume(struct device *dev)
>>  	return 0;
>>  }
>>  
>> -static int mmpcam_runtime_suspend(struct device *dev)
>> +static int __maybe_unused mmpcam_runtime_suspend(struct device *dev)
>>  {
>>  	struct mmp_camera *cam = dev_get_drvdata(dev);
>>  	struct mcam_camera *mcam = &cam->mcam;
>> @@ -335,7 +335,7 @@ static int mmpcam_runtime_suspend(struct device *dev)
>>  	return 0;
>>  }
>>  
>> -static int mmpcam_suspend(struct device *dev)
>> +static int __maybe_unused mmpcam_suspend(struct device *dev)
>>  {
>>  	struct mmp_camera *cam = dev_get_drvdata(dev);
>>  
>> @@ -344,7 +344,7 @@ static int mmpcam_suspend(struct device *dev)
>>  	return 0;
>>  }
>>  
>> -static int mmpcam_resume(struct device *dev)
>> +static int __maybe_unused mmpcam_resume(struct device *dev)
>>  {
>>  	struct mmp_camera *cam = dev_get_drvdata(dev);
>>  
>> -- 
>> 2.17.1
>>
>>
> 
> .
>
Lubomir Rintel Sept. 10, 2020, 2:57 p.m. UTC | #3
On Thu, Sep 10, 2020 at 05:18:15PM +0800, Yuehaibing wrote:
> On 2020/9/10 16:22, Lubomir Rintel wrote:
> > On Thu, Sep 10, 2020 at 04:09:33PM +0800, YueHaibing wrote:
> >> If CONFIG_PM is n, gcc warns:
> >>
> >> drivers/media/platform/marvell-ccic/mmp-driver.c:347:12: warning: ‘mmpcam_resume’ defined but not used [-Wunused-function]
> >>  static int mmpcam_resume(struct device *dev)
> >>             ^~~~~~~~~~~~~
> >> drivers/media/platform/marvell-ccic/mmp-driver.c:338:12: warning: ‘mmpcam_suspend’ defined but not used [-Wunused-function]
> >>  static int mmpcam_suspend(struct device *dev)
> >>             ^~~~~~~~~~~~~~
> >> drivers/media/platform/marvell-ccic/mmp-driver.c:324:12: warning: ‘mmpcam_runtime_suspend’ defined but not used [-Wunused-function]
> >>  static int mmpcam_runtime_suspend(struct device *dev)
> >>             ^~~~~~~~~~~~~~~~~~~~~~
> >> drivers/media/platform/marvell-ccic/mmp-driver.c:310:12: warning: ‘mmpcam_runtime_resume’ defined but not used [-Wunused-function]
> >>  static int mmpcam_runtime_resume(struct device *dev)
> >>             ^~~~~~~~~~~~~~~~~~~~~
> >>
> >> Mark them as __maybe_unused to fix this.
> >>
> >> Reported-by: Hulk Robot <hulkci@huawei.com>
> >> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> > 
> > Your colleague seems to sent out an equivalent patch:
> > https://lore.kernel.org/lkml/20200910080933.40684-1-yuehaibing@huawei.com/
> 
> This is my patch, paste an wrong link?

Indeed, sorry for the confusion.

The original mail only went to linux-media, not lkml, which is why I
picked the wrong one from the archive. Here's the patch:

https://lore.kernel.org/linux-media/20200909112921.5116-1-weiyongjun1@huawei.com/

Take care
Lubo

> 
> > 
> > Cheers
> > Lubo
> > 
> >> ---
> >>  drivers/media/platform/marvell-ccic/mmp-driver.c | 8 ++++----
> >>  1 file changed, 4 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/media/platform/marvell-ccic/mmp-driver.c b/drivers/media/platform/marvell-ccic/mmp-driver.c
> >> index c4b28a00a3a2..032fdddbbecc 100644
> >> --- a/drivers/media/platform/marvell-ccic/mmp-driver.c
> >> +++ b/drivers/media/platform/marvell-ccic/mmp-driver.c
> >> @@ -307,7 +307,7 @@ static int mmpcam_platform_remove(struct platform_device *pdev)
> >>   * Suspend/resume support.
> >>   */
> >>  
> >> -static int mmpcam_runtime_resume(struct device *dev)
> >> +static int __maybe_unused mmpcam_runtime_resume(struct device *dev)
> >>  {
> >>  	struct mmp_camera *cam = dev_get_drvdata(dev);
> >>  	struct mcam_camera *mcam = &cam->mcam;
> >> @@ -321,7 +321,7 @@ static int mmpcam_runtime_resume(struct device *dev)
> >>  	return 0;
> >>  }
> >>  
> >> -static int mmpcam_runtime_suspend(struct device *dev)
> >> +static int __maybe_unused mmpcam_runtime_suspend(struct device *dev)
> >>  {
> >>  	struct mmp_camera *cam = dev_get_drvdata(dev);
> >>  	struct mcam_camera *mcam = &cam->mcam;
> >> @@ -335,7 +335,7 @@ static int mmpcam_runtime_suspend(struct device *dev)
> >>  	return 0;
> >>  }
> >>  
> >> -static int mmpcam_suspend(struct device *dev)
> >> +static int __maybe_unused mmpcam_suspend(struct device *dev)
> >>  {
> >>  	struct mmp_camera *cam = dev_get_drvdata(dev);
> >>  
> >> @@ -344,7 +344,7 @@ static int mmpcam_suspend(struct device *dev)
> >>  	return 0;
> >>  }
> >>  
> >> -static int mmpcam_resume(struct device *dev)
> >> +static int __maybe_unused mmpcam_resume(struct device *dev)
> >>  {
> >>  	struct mmp_camera *cam = dev_get_drvdata(dev);
> >>  
> >> -- 
> >> 2.17.1
> >>
> >>
> > 
> > .
> > 
>
Yue Haibing Sept. 11, 2020, 4:53 a.m. UTC | #4
On 2020/9/10 22:57, Lubomir Rintel wrote:
> On Thu, Sep 10, 2020 at 05:18:15PM +0800, Yuehaibing wrote:
>> On 2020/9/10 16:22, Lubomir Rintel wrote:
>>> On Thu, Sep 10, 2020 at 04:09:33PM +0800, YueHaibing wrote:
>>>> If CONFIG_PM is n, gcc warns:
>>>>
>>>> drivers/media/platform/marvell-ccic/mmp-driver.c:347:12: warning: ‘mmpcam_resume’ defined but not used [-Wunused-function]
>>>>  static int mmpcam_resume(struct device *dev)
>>>>             ^~~~~~~~~~~~~
>>>> drivers/media/platform/marvell-ccic/mmp-driver.c:338:12: warning: ‘mmpcam_suspend’ defined but not used [-Wunused-function]
>>>>  static int mmpcam_suspend(struct device *dev)
>>>>             ^~~~~~~~~~~~~~
>>>> drivers/media/platform/marvell-ccic/mmp-driver.c:324:12: warning: ‘mmpcam_runtime_suspend’ defined but not used [-Wunused-function]
>>>>  static int mmpcam_runtime_suspend(struct device *dev)
>>>>             ^~~~~~~~~~~~~~~~~~~~~~
>>>> drivers/media/platform/marvell-ccic/mmp-driver.c:310:12: warning: ‘mmpcam_runtime_resume’ defined but not used [-Wunused-function]
>>>>  static int mmpcam_runtime_resume(struct device *dev)
>>>>             ^~~~~~~~~~~~~~~~~~~~~
>>>>
>>>> Mark them as __maybe_unused to fix this.
>>>>
>>>> Reported-by: Hulk Robot <hulkci@huawei.com>
>>>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>>>
>>> Your colleague seems to sent out an equivalent patch:
>>> https://lore.kernel.org/lkml/20200910080933.40684-1-yuehaibing@huawei.com/
>>
>> This is my patch, paste an wrong link?
> 
> Indeed, sorry for the confusion.
> 
> The original mail only went to linux-media, not lkml, which is why I
> picked the wrong one from the archive. Here's the patch:
> 
> https://lore.kernel.org/linux-media/20200909112921.5116-1-weiyongjun1@huawei.com/

mmpcam_runtime_suspend/mmpcam_runtime_resume also should be cared, I'll adjust my patch based on it.

> 
> Take care
> Lubo
> 
>>
>>>
>>> Cheers
>>> Lubo
>>>
>>>> ---
>>>>  drivers/media/platform/marvell-ccic/mmp-driver.c | 8 ++++----
>>>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/drivers/media/platform/marvell-ccic/mmp-driver.c b/drivers/media/platform/marvell-ccic/mmp-driver.c
>>>> index c4b28a00a3a2..032fdddbbecc 100644
>>>> --- a/drivers/media/platform/marvell-ccic/mmp-driver.c
>>>> +++ b/drivers/media/platform/marvell-ccic/mmp-driver.c
>>>> @@ -307,7 +307,7 @@ static int mmpcam_platform_remove(struct platform_device *pdev)
>>>>   * Suspend/resume support.
>>>>   */
>>>>  
>>>> -static int mmpcam_runtime_resume(struct device *dev)
>>>> +static int __maybe_unused mmpcam_runtime_resume(struct device *dev)
>>>>  {
>>>>  	struct mmp_camera *cam = dev_get_drvdata(dev);
>>>>  	struct mcam_camera *mcam = &cam->mcam;
>>>> @@ -321,7 +321,7 @@ static int mmpcam_runtime_resume(struct device *dev)
>>>>  	return 0;
>>>>  }
>>>>  
>>>> -static int mmpcam_runtime_suspend(struct device *dev)
>>>> +static int __maybe_unused mmpcam_runtime_suspend(struct device *dev)
>>>>  {
>>>>  	struct mmp_camera *cam = dev_get_drvdata(dev);
>>>>  	struct mcam_camera *mcam = &cam->mcam;
>>>> @@ -335,7 +335,7 @@ static int mmpcam_runtime_suspend(struct device *dev)
>>>>  	return 0;
>>>>  }
>>>>  
>>>> -static int mmpcam_suspend(struct device *dev)
>>>> +static int __maybe_unused mmpcam_suspend(struct device *dev)
>>>>  {
>>>>  	struct mmp_camera *cam = dev_get_drvdata(dev);
>>>>  
>>>> @@ -344,7 +344,7 @@ static int mmpcam_suspend(struct device *dev)
>>>>  	return 0;
>>>>  }
>>>>  
>>>> -static int mmpcam_resume(struct device *dev)
>>>> +static int __maybe_unused mmpcam_resume(struct device *dev)
>>>>  {
>>>>  	struct mmp_camera *cam = dev_get_drvdata(dev);
>>>>  
>>>> -- 
>>>> 2.17.1
>>>>
>>>>
>>>
>>> .
>>>
>>
> 
> .
>
diff mbox series

Patch

diff --git a/drivers/media/platform/marvell-ccic/mmp-driver.c b/drivers/media/platform/marvell-ccic/mmp-driver.c
index c4b28a00a3a2..032fdddbbecc 100644
--- a/drivers/media/platform/marvell-ccic/mmp-driver.c
+++ b/drivers/media/platform/marvell-ccic/mmp-driver.c
@@ -307,7 +307,7 @@  static int mmpcam_platform_remove(struct platform_device *pdev)
  * Suspend/resume support.
  */
 
-static int mmpcam_runtime_resume(struct device *dev)
+static int __maybe_unused mmpcam_runtime_resume(struct device *dev)
 {
 	struct mmp_camera *cam = dev_get_drvdata(dev);
 	struct mcam_camera *mcam = &cam->mcam;
@@ -321,7 +321,7 @@  static int mmpcam_runtime_resume(struct device *dev)
 	return 0;
 }
 
-static int mmpcam_runtime_suspend(struct device *dev)
+static int __maybe_unused mmpcam_runtime_suspend(struct device *dev)
 {
 	struct mmp_camera *cam = dev_get_drvdata(dev);
 	struct mcam_camera *mcam = &cam->mcam;
@@ -335,7 +335,7 @@  static int mmpcam_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int mmpcam_suspend(struct device *dev)
+static int __maybe_unused mmpcam_suspend(struct device *dev)
 {
 	struct mmp_camera *cam = dev_get_drvdata(dev);
 
@@ -344,7 +344,7 @@  static int mmpcam_suspend(struct device *dev)
 	return 0;
 }
 
-static int mmpcam_resume(struct device *dev)
+static int __maybe_unused mmpcam_resume(struct device *dev)
 {
 	struct mmp_camera *cam = dev_get_drvdata(dev);