* [PATCH] 8250: mediatek: mark PM functions as __maybe_unused
@ 2016-02-08 13:36 Arnd Bergmann
2016-02-11 12:07 ` Matthias Brugger
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2016-02-08 13:36 UTC (permalink / raw)
To: Greg Kroah-Hartman, Matthias Brugger
Cc: linux-arm-kernel, Arnd Bergmann, Eddie Huang, Sascha Hauer,
Paul Gortmaker, Matt Redfearn, Paul Burton, Jiri Slaby,
linux-serial, linux-mediatek, linux-kernel
The mtk8250_runtime_suspend function is not used when runtime PM is
disabled, so we get a warning about an unused function:
drivers/tty/serial/8250/8250_mtk.c:119:12: error: 'mtk8250_runtime_suspend' defined but not used [-Werror=unused-function]
static int mtk8250_runtime_suspend(struct device *dev)
This marks all the PM functions as __maybe_unused to avoid the warning,
and removes the #ifdef around the PM_SLEEP functions for consistency.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/tty/serial/8250/8250_mtk.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c
index 0e590b233f03..9038843cadc7 100644
--- a/drivers/tty/serial/8250/8250_mtk.c
+++ b/drivers/tty/serial/8250/8250_mtk.c
@@ -116,7 +116,7 @@ mtk8250_set_termios(struct uart_port *port, struct ktermios *termios,
tty_termios_encode_baud_rate(termios, baud, baud);
}
-static int mtk8250_runtime_suspend(struct device *dev)
+static int __maybe_unused mtk8250_runtime_suspend(struct device *dev)
{
struct mtk8250_data *data = dev_get_drvdata(dev);
@@ -126,7 +126,7 @@ static int mtk8250_runtime_suspend(struct device *dev)
return 0;
}
-static int mtk8250_runtime_resume(struct device *dev)
+static int __maybe_unused mtk8250_runtime_resume(struct device *dev)
{
struct mtk8250_data *data = dev_get_drvdata(dev);
int err;
@@ -245,8 +245,7 @@ static int mtk8250_probe(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
-static int mtk8250_suspend(struct device *dev)
+static int __maybe_unused mtk8250_suspend(struct device *dev)
{
struct mtk8250_data *data = dev_get_drvdata(dev);
@@ -255,7 +254,7 @@ static int mtk8250_suspend(struct device *dev)
return 0;
}
-static int mtk8250_resume(struct device *dev)
+static int __maybe_unused mtk8250_resume(struct device *dev)
{
struct mtk8250_data *data = dev_get_drvdata(dev);
@@ -263,7 +262,6 @@ static int mtk8250_resume(struct device *dev)
return 0;
}
-#endif /* CONFIG_PM_SLEEP */
static const struct dev_pm_ops mtk8250_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(mtk8250_suspend, mtk8250_resume)
--
2.7.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] 8250: mediatek: mark PM functions as __maybe_unused
2016-02-08 13:36 [PATCH] 8250: mediatek: mark PM functions as __maybe_unused Arnd Bergmann
@ 2016-02-11 12:07 ` Matthias Brugger
0 siblings, 0 replies; 2+ messages in thread
From: Matthias Brugger @ 2016-02-11 12:07 UTC (permalink / raw)
To: Arnd Bergmann, Greg Kroah-Hartman
Cc: linux-arm-kernel, Eddie Huang, Sascha Hauer, Paul Gortmaker,
Matt Redfearn, Paul Burton, Jiri Slaby, linux-serial,
linux-mediatek, linux-kernel
On 08/02/16 14:36, Arnd Bergmann wrote:
> The mtk8250_runtime_suspend function is not used when runtime PM is
> disabled, so we get a warning about an unused function:
>
> drivers/tty/serial/8250/8250_mtk.c:119:12: error: 'mtk8250_runtime_suspend' defined but not used [-Werror=unused-function]
> static int mtk8250_runtime_suspend(struct device *dev)
>
> This marks all the PM functions as __maybe_unused to avoid the warning,
> and removes the #ifdef around the PM_SLEEP functions for consistency.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
Acked-by: Matthias Brugger <matthias.bgg@gmail.com>
> drivers/tty/serial/8250/8250_mtk.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c
> index 0e590b233f03..9038843cadc7 100644
> --- a/drivers/tty/serial/8250/8250_mtk.c
> +++ b/drivers/tty/serial/8250/8250_mtk.c
> @@ -116,7 +116,7 @@ mtk8250_set_termios(struct uart_port *port, struct ktermios *termios,
> tty_termios_encode_baud_rate(termios, baud, baud);
> }
>
> -static int mtk8250_runtime_suspend(struct device *dev)
> +static int __maybe_unused mtk8250_runtime_suspend(struct device *dev)
> {
> struct mtk8250_data *data = dev_get_drvdata(dev);
>
> @@ -126,7 +126,7 @@ static int mtk8250_runtime_suspend(struct device *dev)
> return 0;
> }
>
> -static int mtk8250_runtime_resume(struct device *dev)
> +static int __maybe_unused mtk8250_runtime_resume(struct device *dev)
> {
> struct mtk8250_data *data = dev_get_drvdata(dev);
> int err;
> @@ -245,8 +245,7 @@ static int mtk8250_probe(struct platform_device *pdev)
> return 0;
> }
>
> -#ifdef CONFIG_PM_SLEEP
> -static int mtk8250_suspend(struct device *dev)
> +static int __maybe_unused mtk8250_suspend(struct device *dev)
> {
> struct mtk8250_data *data = dev_get_drvdata(dev);
>
> @@ -255,7 +254,7 @@ static int mtk8250_suspend(struct device *dev)
> return 0;
> }
>
> -static int mtk8250_resume(struct device *dev)
> +static int __maybe_unused mtk8250_resume(struct device *dev)
> {
> struct mtk8250_data *data = dev_get_drvdata(dev);
>
> @@ -263,7 +262,6 @@ static int mtk8250_resume(struct device *dev)
>
> return 0;
> }
> -#endif /* CONFIG_PM_SLEEP */
>
> static const struct dev_pm_ops mtk8250_pm_ops = {
> SET_SYSTEM_SLEEP_PM_OPS(mtk8250_suspend, mtk8250_resume)
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-02-11 12:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-08 13:36 [PATCH] 8250: mediatek: mark PM functions as __maybe_unused Arnd Bergmann
2016-02-11 12:07 ` Matthias Brugger
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).