diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2017-08-23 09:42:45 -0400 |
|---|---|---|
| committer | Joerg Roedel <jroedel@suse.de> | 2017-08-28 05:24:52 -0400 |
| commit | 6ce5b0f22d6061b33aaf302f73302f402fea0c17 (patch) | |
| tree | f7bd0e73a686198b90ac8680e3adaffe254d82c7 | |
| parent | d43ecff3efbe0dcff4c239a65b17e68134388ed6 (diff) | |
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.
Fixes: 0ae349a0f33f ("iommu/qcom: Add qcom_iommu")
Acked-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
| -rw-r--r-- | drivers/iommu/qcom_iommu.c | 6 |
1 files 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) | |||
| 860 | return 0; | 860 | return 0; |
| 861 | } | 861 | } |
| 862 | 862 | ||
| 863 | #ifdef CONFIG_PM | 863 | static int __maybe_unused qcom_iommu_resume(struct device *dev) |
| 864 | static int qcom_iommu_resume(struct device *dev) | ||
| 865 | { | 864 | { |
| 866 | struct platform_device *pdev = to_platform_device(dev); | 865 | struct platform_device *pdev = to_platform_device(dev); |
| 867 | struct qcom_iommu_dev *qcom_iommu = platform_get_drvdata(pdev); | 866 | struct qcom_iommu_dev *qcom_iommu = platform_get_drvdata(pdev); |
| @@ -869,7 +868,7 @@ static int qcom_iommu_resume(struct device *dev) | |||
| 869 | return qcom_iommu_enable_clocks(qcom_iommu); | 868 | return qcom_iommu_enable_clocks(qcom_iommu); |
| 870 | } | 869 | } |
| 871 | 870 | ||
| 872 | static int qcom_iommu_suspend(struct device *dev) | 871 | static int __maybe_unused qcom_iommu_suspend(struct device *dev) |
| 873 | { | 872 | { |
| 874 | struct platform_device *pdev = to_platform_device(dev); | 873 | struct platform_device *pdev = to_platform_device(dev); |
| 875 | struct qcom_iommu_dev *qcom_iommu = platform_get_drvdata(pdev); | 874 | struct qcom_iommu_dev *qcom_iommu = platform_get_drvdata(pdev); |
| @@ -878,7 +877,6 @@ static int qcom_iommu_suspend(struct device *dev) | |||
| 878 | 877 | ||
| 879 | return 0; | 878 | return 0; |
| 880 | } | 879 | } |
| 881 | #endif | ||
| 882 | 880 | ||
| 883 | static const struct dev_pm_ops qcom_iommu_pm_ops = { | 881 | static const struct dev_pm_ops qcom_iommu_pm_ops = { |
| 884 | SET_RUNTIME_PM_OPS(qcom_iommu_suspend, qcom_iommu_resume, NULL) | 882 | SET_RUNTIME_PM_OPS(qcom_iommu_suspend, qcom_iommu_resume, NULL) |
