All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu: qcom: annotate PM functions as __maybe_unused
@ 2017-08-23 13:42 Arnd Bergmann
  2017-08-23 13:53 ` Rob Clark
  2017-08-28  9:25 ` Joerg Roedel
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2017-08-23 13:42 UTC (permalink / raw)
  To: Rob Clark, Joerg Roedel
  Cc: Arnd Bergmann, Stanimir Varbanov, iommu, linux-arm-msm, linux-kernel

The qcom_iommu_disable_clocks() function is only called from PM
code that is hidden in an #ifdef, causing a harmless warning without
CONFIG_PM:

drivers/iommu/qcom_iommu.c:601:13: error: 'qcom_iommu_disable_clocks' defined but not used [-Werror=unused-function]
 static void qcom_iommu_disable_clocks(struct qcom_iommu_dev *qcom_iommu)
drivers/iommu/qcom_iommu.c:581:12: error: 'qcom_iommu_enable_clocks' defined but not used [-Werror=unused-function]
 static int qcom_iommu_enable_clocks(struct qcom_iommu_dev *qcom_iommu)

Replacing that #ifdef with __maybe_unused annotations lets the compiler
drop the functions silently instead.

Fixes: 0ae349a0f33f ("iommu/qcom: Add qcom_iommu")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/iommu/qcom_iommu.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/iommu/qcom_iommu.c b/drivers/iommu/qcom_iommu.c
index 48b62aa52787..c8a587d034b0 100644
--- a/drivers/iommu/qcom_iommu.c
+++ b/drivers/iommu/qcom_iommu.c
@@ -860,8 +860,7 @@ static int qcom_iommu_device_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
-static int qcom_iommu_resume(struct device *dev)
+static int __maybe_unused qcom_iommu_resume(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct qcom_iommu_dev *qcom_iommu = platform_get_drvdata(pdev);
@@ -869,7 +868,7 @@ static int qcom_iommu_resume(struct device *dev)
 	return qcom_iommu_enable_clocks(qcom_iommu);
 }
 
-static int qcom_iommu_suspend(struct device *dev)
+static int __maybe_unused qcom_iommu_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 	struct qcom_iommu_dev *qcom_iommu = platform_get_drvdata(pdev);
@@ -878,7 +877,6 @@ static int qcom_iommu_suspend(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops qcom_iommu_pm_ops = {
 	SET_RUNTIME_PM_OPS(qcom_iommu_suspend, qcom_iommu_resume, NULL)
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] iommu: qcom: annotate PM functions as __maybe_unused
  2017-08-23 13:42 [PATCH] iommu: qcom: annotate PM functions as __maybe_unused Arnd Bergmann
@ 2017-08-23 13:53 ` Rob Clark
  2017-08-28  9:25 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Rob Clark @ 2017-08-23 13:53 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Joerg Roedel, Stanimir Varbanov, iommu, linux-arm-msm,
	Linux Kernel Mailing List

On Wed, Aug 23, 2017 at 9:42 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> The qcom_iommu_disable_clocks() function is only called from PM
> code that is hidden in an #ifdef, causing a harmless warning without
> CONFIG_PM:
>
> drivers/iommu/qcom_iommu.c:601:13: error: 'qcom_iommu_disable_clocks' defined but not used [-Werror=unused-function]
>  static void qcom_iommu_disable_clocks(struct qcom_iommu_dev *qcom_iommu)
> drivers/iommu/qcom_iommu.c:581:12: error: 'qcom_iommu_enable_clocks' defined but not used [-Werror=unused-function]
>  static int qcom_iommu_enable_clocks(struct qcom_iommu_dev *qcom_iommu)
>
> Replacing that #ifdef with __maybe_unused annotations lets the compiler
> drop the functions silently instead.
>
> Fixes: 0ae349a0f33f ("iommu/qcom: Add qcom_iommu")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

thanks

Acked-by: Rob Clark <robdclark@gmail.com>

> ---
>  drivers/iommu/qcom_iommu.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iommu/qcom_iommu.c b/drivers/iommu/qcom_iommu.c
> index 48b62aa52787..c8a587d034b0 100644
> --- a/drivers/iommu/qcom_iommu.c
> +++ b/drivers/iommu/qcom_iommu.c
> @@ -860,8 +860,7 @@ static int qcom_iommu_device_remove(struct platform_device *pdev)
>         return 0;
>  }
>
> -#ifdef CONFIG_PM
> -static int qcom_iommu_resume(struct device *dev)
> +static int __maybe_unused qcom_iommu_resume(struct device *dev)
>  {
>         struct platform_device *pdev = to_platform_device(dev);
>         struct qcom_iommu_dev *qcom_iommu = platform_get_drvdata(pdev);
> @@ -869,7 +868,7 @@ static int qcom_iommu_resume(struct device *dev)
>         return qcom_iommu_enable_clocks(qcom_iommu);
>  }
>
> -static int qcom_iommu_suspend(struct device *dev)
> +static int __maybe_unused qcom_iommu_suspend(struct device *dev)
>  {
>         struct platform_device *pdev = to_platform_device(dev);
>         struct qcom_iommu_dev *qcom_iommu = platform_get_drvdata(pdev);
> @@ -878,7 +877,6 @@ static int qcom_iommu_suspend(struct device *dev)
>
>         return 0;
>  }
> -#endif
>
>  static const struct dev_pm_ops qcom_iommu_pm_ops = {
>         SET_RUNTIME_PM_OPS(qcom_iommu_suspend, qcom_iommu_resume, NULL)
> --
> 2.9.0
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] iommu: qcom: annotate PM functions as __maybe_unused
  2017-08-23 13:42 [PATCH] iommu: qcom: annotate PM functions as __maybe_unused Arnd Bergmann
  2017-08-23 13:53 ` Rob Clark
@ 2017-08-28  9:25 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2017-08-28  9:25 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Rob Clark, Stanimir Varbanov, iommu, linux-arm-msm, linux-kernel

On Wed, Aug 23, 2017 at 03:42:45PM +0200, Arnd Bergmann wrote:
> The qcom_iommu_disable_clocks() function is only called from PM
> code that is hidden in an #ifdef, causing a harmless warning without
> CONFIG_PM:
> 
> drivers/iommu/qcom_iommu.c:601:13: error: 'qcom_iommu_disable_clocks' defined but not used [-Werror=unused-function]
>  static void qcom_iommu_disable_clocks(struct qcom_iommu_dev *qcom_iommu)
> drivers/iommu/qcom_iommu.c:581:12: error: 'qcom_iommu_enable_clocks' defined but not used [-Werror=unused-function]
>  static int qcom_iommu_enable_clocks(struct qcom_iommu_dev *qcom_iommu)
> 
> Replacing that #ifdef with __maybe_unused annotations lets the compiler
> drop the functions silently instead.
> 
> Fixes: 0ae349a0f33f ("iommu/qcom: Add qcom_iommu")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/iommu/qcom_iommu.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-28  9:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-23 13:42 [PATCH] iommu: qcom: annotate PM functions as __maybe_unused Arnd Bergmann
2017-08-23 13:53 ` Rob Clark
2017-08-28  9:25 ` Joerg Roedel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.