iommu: qcom: annotate PM functions as __maybe_unused
Subsystems (2)
PATCH 1/1 iommu: qcom: annotate PM functions as __maybe_unused
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.
--- drivers/iommu/qcom_iommu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/iommu/qcom_iommu.c +2 -4
@@ -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 )
Signature · 1 line
2.9.0
Quoted 9 lines · Arnd Bergmann
The
qcom_iommu_disable_clocks()function is only called from PM code that is hidden in an #ifdef, causing a harmless warning withoutCONFIG_PM:
drivers/iommu/qcom_iommu.c:601:13: error: 'qcom_iommu_disable_clocks' defined but not used [-Werror=unused-function]
static voidqcom_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 intqcom_iommu_enable_clocks(struct qcom_iommu_dev *qcom_iommu)
Quoted 5 lines
Replacing that #ifdef with
__maybe_unusedannotations lets the compiler drop the functions silently instead.Fixes 0ae349a0f33f ("iommu/qcom: Add qcom_iommu")Signed-off-by Arnd Bergmann <[email protected]>
thanks
Quoted 38 lines
--- drivers/iommu/qcom_iommu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/iommu/qcom_iommu.c +2
-5@@ -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
Quoted 9 lines · Arnd Bergmann
The
qcom_iommu_disable_clocks()function is only called from PM code that is hidden in an #ifdef, causing a harmless warning withoutCONFIG_PM:
drivers/iommu/qcom_iommu.c:601:13: error: 'qcom_iommu_disable_clocks' defined but not used [-Werror=unused-function]
static voidqcom_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 intqcom_iommu_enable_clocks(struct qcom_iommu_dev *qcom_iommu)
Quoted 8 lines
Replacing that #ifdef with
__maybe_unusedannotations lets the compiler drop the functions silently instead.Fixes 0ae349a0f33f ("iommu/qcom: Add qcom_iommu")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/iommu/qcom_iommu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Applied, thanks.