* [PATCH] drm/rockchip: cdn-dp-core: Make cdn_dp_core_suspend/resume __maybe_unused
@ 2020-04-28 21:31 Arnd Bergmann
2020-04-28 21:54 ` Enric Balletbo i Serra
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2020-04-28 21:31 UTC (permalink / raw)
To: Sandy Huang, Heiko Stübner, David Airlie, Daniel Vetter,
Enric Balletbo i Serra
Cc: Arnd Bergmann, Sam Ravnborg, Thierry Reding, Laurent Pinchart,
dri-devel, linux-arm-kernel, linux-rockchip, linux-kernel
With the new static annotation, the compiler warns when the functions
are actually unused:
drivers/gpu/drm/rockchip/cdn-dp-core.c:1123:12: error: 'cdn_dp_resume' defined but not used [-Werror=unused-function]
1123 | static int cdn_dp_resume(struct device *dev)
| ^~~~~~~~~~~~~
Mark them __maybe_unused to suppress that warning as well.
Fixes: 7c49abb4c2f8 ("drm/rockchip: cdn-dp-core: Make cdn_dp_core_suspend/resume static")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/gpu/drm/rockchip/cdn-dp-core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
index c634b95b50f7..1cde98c6b0e6 100644
--- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
+++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
@@ -1106,7 +1106,7 @@ static const struct component_ops cdn_dp_component_ops = {
.unbind = cdn_dp_unbind,
};
-static int cdn_dp_suspend(struct device *dev)
+static __maybe_unused int cdn_dp_suspend(struct device *dev)
{
struct cdn_dp_device *dp = dev_get_drvdata(dev);
int ret = 0;
@@ -1120,7 +1120,7 @@ static int cdn_dp_suspend(struct device *dev)
return ret;
}
-static int cdn_dp_resume(struct device *dev)
+static __maybe_unused int cdn_dp_resume(struct device *dev)
{
struct cdn_dp_device *dp = dev_get_drvdata(dev);
--
2.26.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/rockchip: cdn-dp-core: Make cdn_dp_core_suspend/resume __maybe_unused
2020-04-28 21:31 [PATCH] drm/rockchip: cdn-dp-core: Make cdn_dp_core_suspend/resume __maybe_unused Arnd Bergmann
@ 2020-04-28 21:54 ` Enric Balletbo i Serra
0 siblings, 0 replies; 2+ messages in thread
From: Enric Balletbo i Serra @ 2020-04-28 21:54 UTC (permalink / raw)
To: Arnd Bergmann, Sandy Huang, Heiko Stübner, David Airlie,
Daniel Vetter
Cc: Sam Ravnborg, Thierry Reding, Laurent Pinchart, dri-devel,
linux-arm-kernel, linux-rockchip, linux-kernel
Hi Arnd,
On 28/4/20 23:31, Arnd Bergmann wrote:
> With the new static annotation, the compiler warns when the functions
> are actually unused:
>
Right, thank you for the patch.
> drivers/gpu/drm/rockchip/cdn-dp-core.c:1123:12: error: 'cdn_dp_resume' defined but not used [-Werror=unused-function]
> 1123 | static int cdn_dp_resume(struct device *dev)
> | ^~~~~~~~~~~~~
>
> Mark them __maybe_unused to suppress that warning as well.
>
> Fixes: 7c49abb4c2f8 ("drm/rockchip: cdn-dp-core: Make cdn_dp_core_suspend/resume static")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
> drivers/gpu/drm/rockchip/cdn-dp-core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> index c634b95b50f7..1cde98c6b0e6 100644
> --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
> +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> @@ -1106,7 +1106,7 @@ static const struct component_ops cdn_dp_component_ops = {
> .unbind = cdn_dp_unbind,
> };
>
> -static int cdn_dp_suspend(struct device *dev)
> +static __maybe_unused int cdn_dp_suspend(struct device *dev)
> {
> struct cdn_dp_device *dp = dev_get_drvdata(dev);
> int ret = 0;
> @@ -1120,7 +1120,7 @@ static int cdn_dp_suspend(struct device *dev)
> return ret;
> }
>
> -static int cdn_dp_resume(struct device *dev)
> +static __maybe_unused int cdn_dp_resume(struct device *dev)
> {
> struct cdn_dp_device *dp = dev_get_drvdata(dev);
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-28 21:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28 21:31 [PATCH] drm/rockchip: cdn-dp-core: Make cdn_dp_core_suspend/resume __maybe_unused Arnd Bergmann
2020-04-28 21:54 ` Enric Balletbo i Serra
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).