[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f30f49f4-f249-d0de-fcfd-1fc52631a1f5@huawei.com>
Date: Tue, 4 Aug 2020 09:39:40 +0800
From: Yuehaibing <yuehaibing@...wei.com>
To: Dmitry Osipenko <digetx@...il.com>, <mchehab@...nel.org>,
<gregkh@...uxfoundation.org>, <thierry.reding@...il.com>,
<jonathanh@...dia.com>, <hverkuil-cisco@...all.nl>
CC: <linux-media@...r.kernel.org>, <linux-tegra@...r.kernel.org>,
<devel@...verdev.osuosl.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] media: staging: tegra-vde: Mark
tegra_vde_runtime_suspend as __maybe_unused
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@...wei.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.
>
> .
>
Powered by blists - more mailing lists