[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <3e7dbbf3-351c-430e-9bfe-a9e9e9cb895c@app.fastmail.com>
Date: Wed, 19 Jul 2023 13:26:06 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Dan Carpenter" <dan.carpenter@...aro.org>,
"Arnd Bergmann" <arnd@...nel.org>
Cc: "Linus Walleij" <linus.walleij@...aro.org>,
"Bartosz Golaszewski" <brgl@...ev.pl>,
"Andy Shevchenko" <andy.shevchenko@...il.com>,
"Shenwei Wang" <shenwei.wang@....com>,
"Andy Shevchenko" <andy@...nel.org>, "Marek Vasut" <marex@...x.de>,
"Marc Zyngier" <maz@...nel.org>,
"Dan Carpenter" <error27@...il.com>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] gpio: mxc: fix unused function warnings
On Wed, Jul 19, 2023, at 11:44, Dan Carpenter wrote:
> On Tue, Jul 18, 2023 at 09:39:08PM +0200, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@...db.de>
>>
>> The new runtime PM support causes a harmless warning about
>> unused functions when runtime PM is disabled:
>>
>> drivers/gpio/gpio-mxc.c:612:12: error: 'mxc_gpio_runtime_resume' defined but not used [-Werror=unused-function]
>> drivers/gpio/gpio-mxc.c:602:12: error: 'mxc_gpio_runtime_suspend' defined but not used [-Werror=unused-function]
>>
>> Change the driver to use the more modern helper macros that avoid these
>> warnings, and remove the now unnecessary __maybe_unused annotations
>>
>> Fixes: 3283d820dce64 ("gpio: mxc: add runtime pm support")
>> Signed-off-by: Arnd Bergmann <arnd@...db.de>
>> ---
>
> The patch is nice, but I don't understand why __maybe_unused doesn't
> work?
Adding __maybe_unused to both mxc_gpio_runtime_resume and
mxc_gpio_runtime_suspend would avoid the warning, and that is
what we used to do in the past before we had the new macros,
including for the mxc_gpio_noirq_suspend/mxc_gpio_noirq_resume
functions in this driver.
Since I'm moving the driver to the new method, it's best to
do it for both pairs of PM functions at the same time, so
the __maybe_unused annotation becomes redundant.
Arnd
Powered by blists - more mailing lists