Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1675880 > unrolled thread

[PATCH 1/3] [media] venus: mark PM functions as __maybe_unused

Started byArnd Bergmann <arnd@arndb.de>
First post2017-06-27 17:10 +0200
Last post2017-06-27 21:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/3] [media] venus: mark PM functions as __maybe_unused Arnd Bergmann <arnd@arndb.de> - 2017-06-27 17:10 +0200
    Re: [PATCH 1/3] [media] venus: mark PM functions as __maybe_unused Stanimir Varbanov <svarbanov@mm-sol.com> - 2017-06-27 21:50 +0200

#1675880 — [PATCH 1/3] [media] venus: mark PM functions as __maybe_unused

FromArnd Bergmann <arnd@arndb.de>
Date2017-06-27 17:10 +0200
Subject[PATCH 1/3] [media] venus: mark PM functions as __maybe_unused
Message-ID<tX0hP-2f9-17@gated-at.bofh.it>
Without PM support, gcc warns about two unused functions:

platform/qcom/venus/core.c:146:13: error: 'venus_clks_disable' defined but not used [-Werror=unused-function]
platform/qcom/venus/core.c:126:12: error: 'venus_clks_enable' defined but not used [-Werror=unused-function]

The problem as usual are incorrect #ifdefs, so the easiest fix
is to do away with the #ifdef completely and mark the suspend/resume
handlers as __maybe_unused, which they are.

Fixes: af2c3834c8ca ("[media] media: venus: adding core part and helper functions")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/media/platform/qcom/venus/core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index d8cbe8549d97..47f79637938c 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -270,8 +270,7 @@ static int venus_remove(struct platform_device *pdev)
 	return ret;
 }
 
-#ifdef CONFIG_PM
-static int venus_runtime_suspend(struct device *dev)
+static __maybe_unused int venus_runtime_suspend(struct device *dev)
 {
 	struct venus_core *core = dev_get_drvdata(dev);
 	int ret;
@@ -283,7 +282,7 @@ static int venus_runtime_suspend(struct device *dev)
 	return ret;
 }
 
-static int venus_runtime_resume(struct device *dev)
+static __maybe_unused int venus_runtime_resume(struct device *dev)
 {
 	struct venus_core *core = dev_get_drvdata(dev);
 	int ret;
@@ -302,7 +301,6 @@ static int venus_runtime_resume(struct device *dev)
 	venus_clks_disable(core);
 	return ret;
 }
-#endif
 
 static const struct dev_pm_ops venus_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-- 
2.9.0

[toc] | [next] | [standalone]


#1676117

FromStanimir Varbanov <svarbanov@mm-sol.com>
Date2017-06-27 21:50 +0200
Message-ID<tX4EO-57v-27@gated-at.bofh.it>
In reply to#1675880
Hi Arnd,

Thanks for the catch!

On 27.06.2017 18:02, Arnd Bergmann wrote:
> Without PM support, gcc warns about two unused functions:
> 
> platform/qcom/venus/core.c:146:13: error: 'venus_clks_disable' defined but not used [-Werror=unused-function]
> platform/qcom/venus/core.c:126:12: error: 'venus_clks_enable' defined but not used [-Werror=unused-function]
> 
> The problem as usual are incorrect #ifdefs, so the easiest fix
> is to do away with the #ifdef completely and mark the suspend/resume
> handlers as __maybe_unused, which they are.
> 
> Fixes: af2c3834c8ca ("[media] media: venus: adding core part and helper functions")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>

> ---
>   drivers/media/platform/qcom/venus/core.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
> index d8cbe8549d97..47f79637938c 100644
> --- a/drivers/media/platform/qcom/venus/core.c
> +++ b/drivers/media/platform/qcom/venus/core.c
> @@ -270,8 +270,7 @@ static int venus_remove(struct platform_device *pdev)
>   	return ret;
>   }
>   
> -#ifdef CONFIG_PM
> -static int venus_runtime_suspend(struct device *dev)
> +static __maybe_unused int venus_runtime_suspend(struct device *dev)
>   {
>   	struct venus_core *core = dev_get_drvdata(dev);
>   	int ret;
> @@ -283,7 +282,7 @@ static int venus_runtime_suspend(struct device *dev)
>   	return ret;
>   }
>   
> -static int venus_runtime_resume(struct device *dev)
> +static __maybe_unused int venus_runtime_resume(struct device *dev)
>   {
>   	struct venus_core *core = dev_get_drvdata(dev);
>   	int ret;
> @@ -302,7 +301,6 @@ static int venus_runtime_resume(struct device *dev)
>   	venus_clks_disable(core);
>   	return ret;
>   }
> -#endif
>   
>   static const struct dev_pm_ops venus_pm_ops = {
>   	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web