* [PATCH] power: bq24190_charger: mark PM functions as __maybe_unused
@ 2017-03-20 13:14 Arnd Bergmann
2017-03-20 14:33 ` Tony Lindgren
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Arnd Bergmann @ 2017-03-20 13:14 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Arnd Bergmann, Tony Lindgren, Liam Breck, Mark Greer,
Colin Ian King, linux-pm, linux-kernel
Without CONFIG_PM, we get a harmless warning:
drivers/power/supply/bq24190_charger.c:1514:12: error: 'bq24190_runtime_resume' defined but not used [-Werror=unused-function]
drivers/power/supply/bq24190_charger.c:1501:12: error: 'bq24190_runtime_suspend' defined but not used [-Werror=unused-function]
To avoid the warning, we can mark all four PM functions as __maybe_unused,
which also lets us remove the incorrect #ifdef.
Fixes: 3d8090cba638 ("power: bq24190_charger: Check the interrupt status on resume")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/power/supply/bq24190_charger.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c
index 6d80670586eb..451f2bc05ea5 100644
--- a/drivers/power/supply/bq24190_charger.c
+++ b/drivers/power/supply/bq24190_charger.c
@@ -1498,7 +1498,7 @@ static int bq24190_remove(struct i2c_client *client)
return 0;
}
-static int bq24190_runtime_suspend(struct device *dev)
+static __maybe_unused int bq24190_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct bq24190_dev_info *bdi = i2c_get_clientdata(client);
@@ -1511,7 +1511,7 @@ static int bq24190_runtime_suspend(struct device *dev)
return 0;
}
-static int bq24190_runtime_resume(struct device *dev)
+static __maybe_unused int bq24190_runtime_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct bq24190_dev_info *bdi = i2c_get_clientdata(client);
@@ -1527,8 +1527,7 @@ static int bq24190_runtime_resume(struct device *dev)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
-static int bq24190_pm_suspend(struct device *dev)
+static __maybe_unused int bq24190_pm_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct bq24190_dev_info *bdi = i2c_get_clientdata(client);
@@ -1550,7 +1549,7 @@ static int bq24190_pm_suspend(struct device *dev)
return 0;
}
-static int bq24190_pm_resume(struct device *dev)
+static __maybe_unused int bq24190_pm_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct bq24190_dev_info *bdi = i2c_get_clientdata(client);
@@ -1580,7 +1579,6 @@ static int bq24190_pm_resume(struct device *dev)
return 0;
}
-#endif
static const struct dev_pm_ops bq24190_pm_ops = {
SET_RUNTIME_PM_OPS(bq24190_runtime_suspend, bq24190_runtime_resume,
--
2.9.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] power: bq24190_charger: mark PM functions as __maybe_unused
2017-03-20 13:14 [PATCH] power: bq24190_charger: mark PM functions as __maybe_unused Arnd Bergmann
@ 2017-03-20 14:33 ` Tony Lindgren
2017-03-20 18:29 ` Liam Breck
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Tony Lindgren @ 2017-03-20 14:33 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sebastian Reichel, Liam Breck, Mark Greer, Colin Ian King,
linux-pm, linux-kernel
* Arnd Bergmann <arnd@arndb.de> [170320 06:17]:
> Without CONFIG_PM, we get a harmless warning:
>
> drivers/power/supply/bq24190_charger.c:1514:12: error: 'bq24190_runtime_resume' defined but not used [-Werror=unused-function]
> drivers/power/supply/bq24190_charger.c:1501:12: error: 'bq24190_runtime_suspend' defined but not used [-Werror=unused-function]
>
> To avoid the warning, we can mark all four PM functions as __maybe_unused,
> which also lets us remove the incorrect #ifdef.
>
> Fixes: 3d8090cba638 ("power: bq24190_charger: Check the interrupt status on resume")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks for fixing that:
Acked-by: Tony Lindgren <tony@atomide.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] power: bq24190_charger: mark PM functions as __maybe_unused
2017-03-20 13:14 [PATCH] power: bq24190_charger: mark PM functions as __maybe_unused Arnd Bergmann
2017-03-20 14:33 ` Tony Lindgren
@ 2017-03-20 18:29 ` Liam Breck
2017-03-20 21:39 ` Sebastian Reichel
2017-03-21 3:55 ` Mark Greer
3 siblings, 0 replies; 5+ messages in thread
From: Liam Breck @ 2017-03-20 18:29 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sebastian Reichel, Tony Lindgren, Mark Greer, Colin Ian King,
linux-pm, linux-kernel
On Mon, Mar 20, 2017 at 6:14 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> Without CONFIG_PM, we get a harmless warning:
>
> drivers/power/supply/bq24190_charger.c:1514:12: error: 'bq24190_runtime_resume' defined but not used [-Werror=unused-function]
> drivers/power/supply/bq24190_charger.c:1501:12: error: 'bq24190_runtime_suspend' defined but not used [-Werror=unused-function]
>
> To avoid the warning, we can mark all four PM functions as __maybe_unused,
> which also lets us remove the incorrect #ifdef.
>
> Fixes: 3d8090cba638 ("power: bq24190_charger: Check the interrupt status on resume")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cool, thx!
Acked-by: Liam Breck <kernel@networkimprov.net>
> ---
> drivers/power/supply/bq24190_charger.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c
> index 6d80670586eb..451f2bc05ea5 100644
> --- a/drivers/power/supply/bq24190_charger.c
> +++ b/drivers/power/supply/bq24190_charger.c
> @@ -1498,7 +1498,7 @@ static int bq24190_remove(struct i2c_client *client)
> return 0;
> }
>
> -static int bq24190_runtime_suspend(struct device *dev)
> +static __maybe_unused int bq24190_runtime_suspend(struct device *dev)
> {
> struct i2c_client *client = to_i2c_client(dev);
> struct bq24190_dev_info *bdi = i2c_get_clientdata(client);
> @@ -1511,7 +1511,7 @@ static int bq24190_runtime_suspend(struct device *dev)
> return 0;
> }
>
> -static int bq24190_runtime_resume(struct device *dev)
> +static __maybe_unused int bq24190_runtime_resume(struct device *dev)
> {
> struct i2c_client *client = to_i2c_client(dev);
> struct bq24190_dev_info *bdi = i2c_get_clientdata(client);
> @@ -1527,8 +1527,7 @@ static int bq24190_runtime_resume(struct device *dev)
> return 0;
> }
>
> -#ifdef CONFIG_PM_SLEEP
> -static int bq24190_pm_suspend(struct device *dev)
> +static __maybe_unused int bq24190_pm_suspend(struct device *dev)
> {
> struct i2c_client *client = to_i2c_client(dev);
> struct bq24190_dev_info *bdi = i2c_get_clientdata(client);
> @@ -1550,7 +1549,7 @@ static int bq24190_pm_suspend(struct device *dev)
> return 0;
> }
>
> -static int bq24190_pm_resume(struct device *dev)
> +static __maybe_unused int bq24190_pm_resume(struct device *dev)
> {
> struct i2c_client *client = to_i2c_client(dev);
> struct bq24190_dev_info *bdi = i2c_get_clientdata(client);
> @@ -1580,7 +1579,6 @@ static int bq24190_pm_resume(struct device *dev)
>
> return 0;
> }
> -#endif
>
> static const struct dev_pm_ops bq24190_pm_ops = {
> SET_RUNTIME_PM_OPS(bq24190_runtime_suspend, bq24190_runtime_resume,
> --
> 2.9.0
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] power: bq24190_charger: mark PM functions as __maybe_unused
2017-03-20 13:14 [PATCH] power: bq24190_charger: mark PM functions as __maybe_unused Arnd Bergmann
2017-03-20 14:33 ` Tony Lindgren
2017-03-20 18:29 ` Liam Breck
@ 2017-03-20 21:39 ` Sebastian Reichel
2017-03-21 3:55 ` Mark Greer
3 siblings, 0 replies; 5+ messages in thread
From: Sebastian Reichel @ 2017-03-20 21:39 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Tony Lindgren, Liam Breck, Mark Greer, Colin Ian King, linux-pm,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 693 bytes --]
Hi,
On Mon, Mar 20, 2017 at 02:14:15PM +0100, Arnd Bergmann wrote:
> Without CONFIG_PM, we get a harmless warning:
>
> drivers/power/supply/bq24190_charger.c:1514:12: error: 'bq24190_runtime_resume' defined but not used [-Werror=unused-function]
> drivers/power/supply/bq24190_charger.c:1501:12: error: 'bq24190_runtime_suspend' defined but not used [-Werror=unused-function]
>
> To avoid the warning, we can mark all four PM functions as __maybe_unused,
> which also lets us remove the incorrect #ifdef.
>
> Fixes: 3d8090cba638 ("power: bq24190_charger: Check the interrupt status on resume")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks, queued.
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] power: bq24190_charger: mark PM functions as __maybe_unused
2017-03-20 13:14 [PATCH] power: bq24190_charger: mark PM functions as __maybe_unused Arnd Bergmann
` (2 preceding siblings ...)
2017-03-20 21:39 ` Sebastian Reichel
@ 2017-03-21 3:55 ` Mark Greer
3 siblings, 0 replies; 5+ messages in thread
From: Mark Greer @ 2017-03-21 3:55 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sebastian Reichel, Tony Lindgren, Liam Breck, Mark Greer,
Colin Ian King, linux-pm, linux-kernel
On Mon, Mar 20, 2017 at 02:14:15PM +0100, Arnd Bergmann wrote:
> Without CONFIG_PM, we get a harmless warning:
>
> drivers/power/supply/bq24190_charger.c:1514:12: error: 'bq24190_runtime_resume' defined but not used [-Werror=unused-function]
> drivers/power/supply/bq24190_charger.c:1501:12: error: 'bq24190_runtime_suspend' defined but not used [-Werror=unused-function]
>
> To avoid the warning, we can mark all four PM functions as __maybe_unused,
> which also lets us remove the incorrect #ifdef.
>
> Fixes: 3d8090cba638 ("power: bq24190_charger: Check the interrupt status on resume")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
Probably too late but if it isn't...
Acked-by: Mark Greer <mgreer@animalcreek.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-03-21 3:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-20 13:14 [PATCH] power: bq24190_charger: mark PM functions as __maybe_unused Arnd Bergmann
2017-03-20 14:33 ` Tony Lindgren
2017-03-20 18:29 ` Liam Breck
2017-03-20 21:39 ` Sebastian Reichel
2017-03-21 3:55 ` Mark Greer
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).