linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] media: staging: tegra-vde: Mark tegra_vde_runtime_suspend as __maybe_unused
@ 2020-08-03 11:59 YueHaibing
  2020-08-03 12:51 ` Dmitry Osipenko
  2020-08-04  1:41 ` [PATCH v2 -next] media: staging: tegra-vde: Mark tegra_vde_runtime_suspend/resume " YueHaibing
  0 siblings, 2 replies; 7+ messages in thread
From: YueHaibing @ 2020-08-03 11:59 UTC (permalink / raw)
  To: digetx, mchehab, gregkh, thierry.reding, jonathanh, hverkuil-cisco
  Cc: linux-media, linux-tegra, devel, linux-kernel, YueHaibing

If CONFIG_PM is not set, gcc warns:

drivers/staging/media/tegra-vde/vde.c:916:12:
 warning: 'tegra_vde_runtime_suspend' defined but not used [-Wunused-function]

Make it __maybe_unused to fix this.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/staging/media/tegra-vde/vde.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/tegra-vde/vde.c b/drivers/staging/media/tegra-vde/vde.c
index a3c24d96d5b9..2d043d518eef 100644
--- a/drivers/staging/media/tegra-vde/vde.c
+++ b/drivers/staging/media/tegra-vde/vde.c
@@ -913,7 +913,7 @@ static irqreturn_t tegra_vde_isr(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-static int tegra_vde_runtime_suspend(struct device *dev)
+static __maybe_unused int tegra_vde_runtime_suspend(struct device *dev)
 {
 	struct tegra_vde *vde = dev_get_drvdata(dev);
 	int err;
-- 
2.17.1



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

* Re: [PATCH -next] media: staging: tegra-vde: Mark tegra_vde_runtime_suspend as __maybe_unused
  2020-08-03 11:59 [PATCH -next] media: staging: tegra-vde: Mark tegra_vde_runtime_suspend as __maybe_unused YueHaibing
@ 2020-08-03 12:51 ` Dmitry Osipenko
  2020-08-03 13:00   ` Yuehaibing
  2020-08-04  1:41 ` [PATCH v2 -next] media: staging: tegra-vde: Mark tegra_vde_runtime_suspend/resume " YueHaibing
  1 sibling, 1 reply; 7+ messages in thread
From: Dmitry Osipenko @ 2020-08-03 12:51 UTC (permalink / raw)
  To: YueHaibing, mchehab, gregkh, thierry.reding, jonathanh, hverkuil-cisco
  Cc: linux-media, linux-tegra, devel, linux-kernel

03.08.2020 14:59, YueHaibing пишет:
> If CONFIG_PM is not set, gcc warns:
> 
> drivers/staging/media/tegra-vde/vde.c:916:12:
>  warning: 'tegra_vde_runtime_suspend' defined but not used [-Wunused-function]
> 
> Make it __maybe_unused to fix this.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/staging/media/tegra-vde/vde.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/tegra-vde/vde.c b/drivers/staging/media/tegra-vde/vde.c
> index a3c24d96d5b9..2d043d518eef 100644
> --- a/drivers/staging/media/tegra-vde/vde.c
> +++ b/drivers/staging/media/tegra-vde/vde.c
> @@ -913,7 +913,7 @@ static irqreturn_t tegra_vde_isr(int irq, void *data)
>  	return IRQ_HANDLED;
>  }
>  
> -static int tegra_vde_runtime_suspend(struct device *dev)
> +static __maybe_unused int tegra_vde_runtime_suspend(struct device *dev)
>  {
>  	struct tegra_vde *vde = dev_get_drvdata(dev);
>  	int err;
> 

Hello Yue,

Shouldn't the tegra_vde_runtime_resume() be marked as well?

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

* Re: [PATCH -next] media: staging: tegra-vde: Mark tegra_vde_runtime_suspend as __maybe_unused
  2020-08-03 12:51 ` Dmitry Osipenko
@ 2020-08-03 13:00   ` Yuehaibing
  2020-08-03 14:11     ` Dmitry Osipenko
  0 siblings, 1 reply; 7+ messages in thread
From: Yuehaibing @ 2020-08-03 13:00 UTC (permalink / raw)
  To: Dmitry Osipenko, mchehab, gregkh, thierry.reding, jonathanh,
	hverkuil-cisco
  Cc: linux-media, linux-tegra, devel, linux-kernel

On 2020/8/3 20:51, Dmitry Osipenko wrote:
> 03.08.2020 14:59, YueHaibing пишет:
>> If CONFIG_PM is not set, gcc warns:
>>
>> drivers/staging/media/tegra-vde/vde.c:916:12:
>>  warning: 'tegra_vde_runtime_suspend' defined but not used [-Wunused-function]
>>
>> Make it __maybe_unused to fix this.
>>
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>> ---
>>  drivers/staging/media/tegra-vde/vde.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/media/tegra-vde/vde.c b/drivers/staging/media/tegra-vde/vde.c
>> index a3c24d96d5b9..2d043d518eef 100644
>> --- a/drivers/staging/media/tegra-vde/vde.c
>> +++ b/drivers/staging/media/tegra-vde/vde.c
>> @@ -913,7 +913,7 @@ static irqreturn_t tegra_vde_isr(int irq, void *data)
>>  	return IRQ_HANDLED;
>>  }
>>  
>> -static int tegra_vde_runtime_suspend(struct device *dev)
>> +static __maybe_unused int tegra_vde_runtime_suspend(struct device *dev)
>>  {
>>  	struct tegra_vde *vde = dev_get_drvdata(dev);
>>  	int err;
>>
> 
> Hello Yue,
> 
> Shouldn't the tegra_vde_runtime_resume() be marked as well?

No, tegra_vde_runtime_resume() always be called by tegra_vde_shutdown().

> 
> .
> 


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

* Re: [PATCH -next] media: staging: tegra-vde: Mark tegra_vde_runtime_suspend as __maybe_unused
  2020-08-03 13:00   ` Yuehaibing
@ 2020-08-03 14:11     ` Dmitry Osipenko
  2020-08-04  1:39       ` Yuehaibing
  0 siblings, 1 reply; 7+ messages in thread
From: Dmitry Osipenko @ 2020-08-03 14:11 UTC (permalink / raw)
  To: Yuehaibing, mchehab, gregkh, thierry.reding, jonathanh, hverkuil-cisco
  Cc: linux-media, linux-tegra, devel, linux-kernel

03.08.2020 16:00, Yuehaibing пишет:
> On 2020/8/3 20:51, Dmitry Osipenko wrote:
>> 03.08.2020 14:59, YueHaibing пишет:
>>> If CONFIG_PM is not set, gcc warns:
>>>
>>> drivers/staging/media/tegra-vde/vde.c:916:12:
>>>  warning: 'tegra_vde_runtime_suspend' defined but not used [-Wunused-function]
>>>
>>> Make it __maybe_unused to fix this.
>>>
>>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>>> ---
>>>  drivers/staging/media/tegra-vde/vde.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/staging/media/tegra-vde/vde.c b/drivers/staging/media/tegra-vde/vde.c
>>> index a3c24d96d5b9..2d043d518eef 100644
>>> --- a/drivers/staging/media/tegra-vde/vde.c
>>> +++ b/drivers/staging/media/tegra-vde/vde.c
>>> @@ -913,7 +913,7 @@ static irqreturn_t tegra_vde_isr(int irq, void *data)
>>>  	return IRQ_HANDLED;
>>>  }
>>>  
>>> -static int tegra_vde_runtime_suspend(struct device *dev)
>>> +static __maybe_unused int tegra_vde_runtime_suspend(struct device *dev)
>>>  {
>>>  	struct tegra_vde *vde = dev_get_drvdata(dev);
>>>  	int err;
>>>
>>
>> Hello Yue,
>>
>> Shouldn't the tegra_vde_runtime_resume() be marked as well?
> 
> No, tegra_vde_runtime_resume() always be called by tegra_vde_shutdown().

Well.. it's unused, but compiler doesn't complain about runtime_resume()
because it sees the potential reference to that function in the code
(even that it's a dead code), while runtime_suspend() reference is
completely removed by preprocessor before compiler sees the code.

Should be nicer to have both suspend and resume functions marked, for
consistency, IMO.

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

* Re: [PATCH -next] media: staging: tegra-vde: Mark tegra_vde_runtime_suspend as __maybe_unused
  2020-08-03 14:11     ` Dmitry Osipenko
@ 2020-08-04  1:39       ` Yuehaibing
  0 siblings, 0 replies; 7+ messages in thread
From: Yuehaibing @ 2020-08-04  1:39 UTC (permalink / raw)
  To: Dmitry Osipenko, mchehab, gregkh, thierry.reding, jonathanh,
	hverkuil-cisco
  Cc: linux-media, linux-tegra, devel, linux-kernel

On 2020/8/3 22:11, Dmitry Osipenko wrote:
> 03.08.2020 16:00, Yuehaibing пишет:
>> On 2020/8/3 20:51, Dmitry Osipenko wrote:
>>> 03.08.2020 14:59, YueHaibing пишет:
>>>> If CONFIG_PM is not set, gcc warns:
>>>>
>>>> drivers/staging/media/tegra-vde/vde.c:916:12:
>>>>  warning: 'tegra_vde_runtime_suspend' defined but not used [-Wunused-function]
>>>>
>>>> Make it __maybe_unused to fix this.
>>>>
>>>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>>>> ---
>>>>  drivers/staging/media/tegra-vde/vde.c | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/staging/media/tegra-vde/vde.c b/drivers/staging/media/tegra-vde/vde.c
>>>> index a3c24d96d5b9..2d043d518eef 100644
>>>> --- a/drivers/staging/media/tegra-vde/vde.c
>>>> +++ b/drivers/staging/media/tegra-vde/vde.c
>>>> @@ -913,7 +913,7 @@ static irqreturn_t tegra_vde_isr(int irq, void *data)
>>>>  	return IRQ_HANDLED;
>>>>  }
>>>>  
>>>> -static int tegra_vde_runtime_suspend(struct device *dev)
>>>> +static __maybe_unused int tegra_vde_runtime_suspend(struct device *dev)
>>>>  {
>>>>  	struct tegra_vde *vde = dev_get_drvdata(dev);
>>>>  	int err;
>>>>
>>>
>>> Hello Yue,
>>>
>>> Shouldn't the tegra_vde_runtime_resume() be marked as well?
>>
>> No, tegra_vde_runtime_resume() always be called by tegra_vde_shutdown().
> 
> Well.. it's unused, but compiler doesn't complain about runtime_resume()
> because it sees the potential reference to that function in the code
> (even that it's a dead code), while runtime_suspend() reference is
> completely removed by preprocessor before compiler sees the code.
> 

I see, thanks, will send v2.

> Should be nicer to have both suspend and resume functions marked, for
> consistency, IMO.
> 
> .
> 


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

* [PATCH v2 -next] media: staging: tegra-vde: Mark tegra_vde_runtime_suspend/resume as __maybe_unused
  2020-08-03 11:59 [PATCH -next] media: staging: tegra-vde: Mark tegra_vde_runtime_suspend as __maybe_unused YueHaibing
  2020-08-03 12:51 ` Dmitry Osipenko
@ 2020-08-04  1:41 ` YueHaibing
  2020-08-04  5:58   ` Dmitry Osipenko
  1 sibling, 1 reply; 7+ messages in thread
From: YueHaibing @ 2020-08-04  1:41 UTC (permalink / raw)
  To: digetx, mchehab, gregkh, thierry.reding, jonathanh, hverkuil-cisco
  Cc: linux-media, linux-tegra, devel, linux-kernel, YueHaibing

If CONFIG_PM is not set, gcc warns:

drivers/staging/media/tegra-vde/vde.c:916:12:
 warning: 'tegra_vde_runtime_suspend' defined but not used [-Wunused-function]

Make it __maybe_unused to fix this.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2: both suspend and resume functions marked
---
 drivers/staging/media/tegra-vde/vde.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/tegra-vde/vde.c b/drivers/staging/media/tegra-vde/vde.c
index a3c24d96d5b9..28845b5bafaf 100644
--- a/drivers/staging/media/tegra-vde/vde.c
+++ b/drivers/staging/media/tegra-vde/vde.c
@@ -913,7 +913,7 @@ static irqreturn_t tegra_vde_isr(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-static int tegra_vde_runtime_suspend(struct device *dev)
+static __maybe_unused int tegra_vde_runtime_suspend(struct device *dev)
 {
 	struct tegra_vde *vde = dev_get_drvdata(dev);
 	int err;
@@ -929,7 +929,7 @@ static int tegra_vde_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int tegra_vde_runtime_resume(struct device *dev)
+static __maybe_unused int tegra_vde_runtime_resume(struct device *dev)
 {
 	struct tegra_vde *vde = dev_get_drvdata(dev);
 	int err;
-- 
2.17.1



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

* Re: [PATCH v2 -next] media: staging: tegra-vde: Mark tegra_vde_runtime_suspend/resume as __maybe_unused
  2020-08-04  1:41 ` [PATCH v2 -next] media: staging: tegra-vde: Mark tegra_vde_runtime_suspend/resume " YueHaibing
@ 2020-08-04  5:58   ` Dmitry Osipenko
  0 siblings, 0 replies; 7+ messages in thread
From: Dmitry Osipenko @ 2020-08-04  5:58 UTC (permalink / raw)
  To: YueHaibing, mchehab, gregkh, thierry.reding, jonathanh, hverkuil-cisco
  Cc: linux-media, linux-tegra, devel, linux-kernel

04.08.2020 04:41, YueHaibing пишет:
> If CONFIG_PM is not set, gcc warns:
> 
> drivers/staging/media/tegra-vde/vde.c:916:12:
>  warning: 'tegra_vde_runtime_suspend' defined but not used [-Wunused-function]
> 
> Make it __maybe_unused to fix this.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> v2: both suspend and resume functions marked
> ---
>  drivers/staging/media/tegra-vde/vde.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/media/tegra-vde/vde.c b/drivers/staging/media/tegra-vde/vde.c
> index a3c24d96d5b9..28845b5bafaf 100644
> --- a/drivers/staging/media/tegra-vde/vde.c
> +++ b/drivers/staging/media/tegra-vde/vde.c
> @@ -913,7 +913,7 @@ static irqreturn_t tegra_vde_isr(int irq, void *data)
>  	return IRQ_HANDLED;
>  }
>  
> -static int tegra_vde_runtime_suspend(struct device *dev)
> +static __maybe_unused int tegra_vde_runtime_suspend(struct device *dev)
>  {
>  	struct tegra_vde *vde = dev_get_drvdata(dev);
>  	int err;
> @@ -929,7 +929,7 @@ static int tegra_vde_runtime_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int tegra_vde_runtime_resume(struct device *dev)
> +static __maybe_unused int tegra_vde_runtime_resume(struct device *dev)
>  {
>  	struct tegra_vde *vde = dev_get_drvdata(dev);
>  	int err;
> 

Thanks!

Reviewed-by: Dmitry Osipenko <digetx@gmail.com>

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

end of thread, other threads:[~2020-08-04  5:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-03 11:59 [PATCH -next] media: staging: tegra-vde: Mark tegra_vde_runtime_suspend as __maybe_unused YueHaibing
2020-08-03 12:51 ` Dmitry Osipenko
2020-08-03 13:00   ` Yuehaibing
2020-08-03 14:11     ` Dmitry Osipenko
2020-08-04  1:39       ` Yuehaibing
2020-08-04  1:41 ` [PATCH v2 -next] media: staging: tegra-vde: Mark tegra_vde_runtime_suspend/resume " YueHaibing
2020-08-04  5:58   ` Dmitry Osipenko

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