* [PATCH, RESEND] drm: exynos: avoid unused function warning
@ 2016-09-06 13:30 Arnd Bergmann
2016-09-06 14:08 ` Andrzej Hajda
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2016-09-06 13:30 UTC (permalink / raw)
To: Inki Dae, Joonyoung Shim, Seung-Woo Kim, Kyungmin Park
Cc: Arnd Bergmann, David Airlie, Kukjin Kim, Krzysztof Kozlowski,
Javier Martinez Canillas, Marek Szyprowski, Gustavo Padovan,
Ingi Kim, dri-devel, linux-arm-kernel, linux-samsung-soc,
linux-kernel
When CONFIG_PM is not set, we get a warning about an unused function:
drivers/gpu/drm/exynos/exynos_drm_gsc.c:1219:12: error: 'gsc_clk_ctrl' defined but not used [-Werror=unused-function]
static int gsc_clk_ctrl(struct gsc_context *ctx, bool enable)
^~~~~~~~~~~~
This removes the two #ifdef checks in this file and instead marks the
functions as __maybe_unused, which is a more reliable way of doing the
same, allowing better build coverage and avoiding the warning above.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/gpu/drm/exynos/exynos_drm_gsc.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
Originally sent on July 11, but I just got this again and noticed
it had never been applied, and I didn't get any reply for the patch.
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
index 5d20da8f957e..b0a773790f85 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
@@ -1760,8 +1760,7 @@ static int gsc_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
-static int gsc_suspend(struct device *dev)
+static int __maybe_unused gsc_suspend(struct device *dev)
{
struct gsc_context *ctx = get_gsc_context(dev);
@@ -1773,7 +1772,7 @@ static int gsc_suspend(struct device *dev)
return gsc_clk_ctrl(ctx, false);
}
-static int gsc_resume(struct device *dev)
+static int __maybe_unused gsc_resume(struct device *dev)
{
struct gsc_context *ctx = get_gsc_context(dev);
@@ -1784,10 +1783,8 @@ static int gsc_resume(struct device *dev)
return 0;
}
-#endif
-#ifdef CONFIG_PM
-static int gsc_runtime_suspend(struct device *dev)
+static int __maybe_unused gsc_runtime_suspend(struct device *dev)
{
struct gsc_context *ctx = get_gsc_context(dev);
@@ -1796,7 +1793,7 @@ static int gsc_runtime_suspend(struct device *dev)
return gsc_clk_ctrl(ctx, false);
}
-static int gsc_runtime_resume(struct device *dev)
+static int __maybe_unused gsc_runtime_resume(struct device *dev)
{
struct gsc_context *ctx = get_gsc_context(dev);
@@ -1804,7 +1801,6 @@ static int gsc_runtime_resume(struct device *dev)
return gsc_clk_ctrl(ctx, true);
}
-#endif
static const struct dev_pm_ops gsc_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(gsc_suspend, gsc_resume)
--
2.9.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH, RESEND] drm: exynos: avoid unused function warning
2016-09-06 13:30 [PATCH, RESEND] drm: exynos: avoid unused function warning Arnd Bergmann
@ 2016-09-06 14:08 ` Andrzej Hajda
0 siblings, 0 replies; 2+ messages in thread
From: Andrzej Hajda @ 2016-09-06 14:08 UTC (permalink / raw)
To: Arnd Bergmann, Inki Dae, Joonyoung Shim, Seung-Woo Kim, Kyungmin Park
Cc: linux-samsung-soc, linux-kernel, Krzysztof Kozlowski,
Javier Martinez Canillas, Kukjin Kim, dri-devel, Ingi Kim,
Gustavo Padovan, linux-arm-kernel, Marek Szyprowski
On 09/06/2016 03:30 PM, Arnd Bergmann wrote:
> When CONFIG_PM is not set, we get a warning about an unused function:
>
> drivers/gpu/drm/exynos/exynos_drm_gsc.c:1219:12: error: 'gsc_clk_ctrl' defined but not used [-Werror=unused-function]
> static int gsc_clk_ctrl(struct gsc_context *ctx, bool enable)
> ^~~~~~~~~~~~
>
> This removes the two #ifdef checks in this file and instead marks the
> functions as __maybe_unused, which is a more reliable way of doing the
> same, allowing better build coverage and avoiding the warning above.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
--
Regards
Andrzej
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-06 14:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-06 13:30 [PATCH, RESEND] drm: exynos: avoid unused function warning Arnd Bergmann
2016-09-06 14:08 ` Andrzej Hajda
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®