Skip to contentSkip to conversation

mailbox: qcom-ipcc: Fix -Wunused-function with CONFIG_PM_SLEEP=n

PATCH In review Nathan Chancellor 3 participants 3 messages May 23, 2022 – May 24, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mailbox: qcom-ipcc: Fix -Wunused-function with CONFIG_PM_SLEEP=n

When CONFIG_PM_SLEEP is not set, there is a warning that qcom_ipcc_pm_resume() is unused:

drivers/mailbox/qcom-ipcc.c:258:12: error: 'qcom_ipcc_pm_resume' defined but not used [-Werror=unused-function]
258 | static int qcom_ipcc_pm_resume(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Commit 1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros, deprecate old ones") reworked the PM_OPS macros to avoid this problem. Use NOIRQ_SYSTEM_SLEEP_PM_OPS directly so that qcom_ipcc_pm_resume() always appears to be used to the compiler, even though it will be dead code eliminated in the !CONFIG_PM_SLEEP case.

Fixes c25f77899753 ("mailbox: qcom-ipcc: Log the pending interrupt during resume")
---
 drivers/mailbox/qcom-ipcc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mailbox/qcom-ipcc.c +1 -1
index 2583b20cdeb7..31d58b7d55fe 100644
@@ -344,7 +344,7 @@ static const struct of_device_id qcom_ipcc_of_match[] = {
 MODULE_DEVICE_TABLE(of, qcom_ipcc_of_match);
 
 static const struct dev_pm_ops qcom_ipcc_dev_pm_ops = {
-	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(NULL, qcom_ipcc_pm_resume)
+	NOIRQ_SYSTEM_SLEEP_PM_OPS(NULL, qcom_ipcc_pm_resume)
 };
 
 static struct platform_driver qcom_ipcc_driver = {

base-commit: bca1a1004615efe141fd78f360ecc48c60bc4ad5

Signature · 1 line
2.36.1
Reviewed-by on v1 1/1
#1 lore raw

Hey Nathan,
Thanks for the fix!

Quoted 8 lines · Nathan Chancellor

When CONFIG_PM_SLEEP is not set, there is a warning that qcom_ipcc_pm_resume() is unused:

drivers/mailbox/qcom-ipcc.c:258:12: error: 'qcom_ipcc_pm_resume' defined but not used [-Werror=unused-function]
258 | static int qcom_ipcc_pm_resume(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Quoted 8 lines

Commit 1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros, deprecate old ones") reworked the PM_OPS macros to avoid this problem. Use NOIRQ_SYSTEM_SLEEP_PM_OPS directly so that qcom_ipcc_pm_resume() always appears to be used to the compiler, even though it will be dead code eliminated in the !CONFIG_PM_SLEEP case.

Fixes c25f77899753 ("mailbox: qcom-ipcc: Log the pending interrupt during resume")
Quoted 20 lines
---
  drivers/mailbox/qcom-ipcc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mailbox/qcom-ipcc.c +1 -1
index 2583b20cdeb7..31d58b7d55fe 100644
@@ -344,7 +344,7 @@ static const struct of_device_id qcom_ipcc_of_match[] = {
  MODULE_DEVICE_TABLE(of, qcom_ipcc_of_match);
 
  static const struct dev_pm_ops qcom_ipcc_dev_pm_ops = {
-	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(NULL, qcom_ipcc_pm_resume)
+	NOIRQ_SYSTEM_SLEEP_PM_OPS(NULL, qcom_ipcc_pm_resume)
  };
 
  static struct platform_driver qcom_ipcc_driver = {

base-commit: bca1a1004615efe141fd78f360ecc48c60bc4ad5

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Nathan Chancellor
Quoted 8 lines · Nathan Chancellor

When CONFIG_PM_SLEEP is not set, there is a warning that qcom_ipcc_pm_resume() is unused:

drivers/mailbox/qcom-ipcc.c:258:12: error: 'qcom_ipcc_pm_resume' defined but not used [-Werror=unused-function]
258 | static int qcom_ipcc_pm_resume(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Quoted 8 lines

Commit 1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros, deprecate old ones") reworked the PM_OPS macros to avoid this problem. Use NOIRQ_SYSTEM_SLEEP_PM_OPS directly so that qcom_ipcc_pm_resume() always appears to be used to the compiler, even though it will be dead code eliminated in the !CONFIG_PM_SLEEP case.

Fixes c25f77899753 ("mailbox: qcom-ipcc: Log the pending interrupt during resume")

My bad, I missed this. Thanks for the fix!

Thanks,
Mani

Quoted 22 lines
---
 drivers/mailbox/qcom-ipcc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mailbox/qcom-ipcc.c +1 -1
index 2583b20cdeb7..31d58b7d55fe 100644
@@ -344,7 +344,7 @@ static const struct of_device_id qcom_ipcc_of_match[] = {
 MODULE_DEVICE_TABLE(of, qcom_ipcc_of_match);
 
 static const struct dev_pm_ops qcom_ipcc_dev_pm_ops = {
-	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(NULL, qcom_ipcc_pm_resume)
+	NOIRQ_SYSTEM_SLEEP_PM_OPS(NULL, qcom_ipcc_pm_resume)
 };
 
 static struct platform_driver qcom_ipcc_driver = {

base-commit: bca1a1004615efe141fd78f360ecc48c60bc4ad5

Signature · 1 line
2.36.1
Signature · 1 line
மணிவண்ணன் சதாசிவம்