Skip to contentSkip to conversation

dmaengine: idma64: Switch to use __maybe_unused instead of ifdeffery

PATCH Applied Andy Shevchenko 2 participants 2 messages Nov 4, 2020 – Nov 9, 2020

Subsystems (2)
lore
Share & tools
lore

Andy Shevchenko

author reviewer
#0 lore raw

PATCH 1/1 dmaengine: idma64: Switch to use __maybe_unused instead of ifdeffery

ifdeffery is prone to errors and makes code harder to read. Switch to use __maybe_unused instead of ifdeffery.

---
 drivers/dma/idma64.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/dma/idma64.c +2 -6
index f5a84c846394..f4c07ad3be15 100644
@@ -667,9 +667,7 @@ static int idma64_platform_remove(struct platform_device *pdev)
 	return idma64_remove(chip);
 }
 
-#ifdef CONFIG_PM_SLEEP
-
-static int idma64_pm_suspend(struct device *dev)
+static int __maybe_unused idma64_pm_suspend(struct device *dev)
 {
 	struct idma64_chip *chip = dev_get_drvdata(dev);
 
@@ -677,7 +675,7 @@ static int idma64_pm_suspend(struct device *dev)
 	return 0;
 }
 
-static int idma64_pm_resume(struct device *dev)
+static int __maybe_unused idma64_pm_resume(struct device *dev)
 {
 	struct idma64_chip *chip = dev_get_drvdata(dev);
 
@@ -685,8 +683,6 @@ static int idma64_pm_resume(struct device *dev)
 	return 0;
 }
 
-#endif /* CONFIG_PM_SLEEP */
-
 static const struct dev_pm_ops idma64_dev_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(idma64_pm_suspend, idma64_pm_resume)
 };
Signature · 1 line
2.28.0
maintainer Applied
#1 lore raw
Quoted 2 lines · Andy Shevchenko

ifdeffery is prone to errors and makes code harder to read. Switch to use __maybe_unused instead of ifdeffery.

Applied, thanks

Signature · 1 line
~Vinod