Skip to contentSkip to conversation

drm/bridge: cdns: Mark runtime PM operations as maybe unused

PATCH In review Thierry Reding 2 participants 3 messages Apr 26, 2018

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

PATCH 1/1 drm/bridge: cdns: Mark runtime PM operations as maybe unused

From: Thierry Reding <[email protected]>

Building the driver in a configuration with !PM currently causes a warning about these operations being unused. Mark them as such to shut up the compiler.

---
 drivers/gpu/drm/bridge/cdns-dsi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/cdns-dsi.c +2 -2
index c255fc3e1be5..f2d43f24acfb 100644
@@ -1337,7 +1337,7 @@ static const struct mipi_dsi_host_ops cdns_dsi_ops = {
 	.transfer = cdns_dsi_transfer,
 };
 
-static int cdns_dsi_resume(struct device *dev)
+static int __maybe_unused cdns_dsi_resume(struct device *dev)
 {
 	struct cdns_dsi *dsi = dev_get_drvdata(dev);
 
@@ -1350,7 +1350,7 @@ static int cdns_dsi_resume(struct device *dev)
 	return 0;
 }
 
-static int cdns_dsi_suspend(struct device *dev)
+static int __maybe_unused cdns_dsi_suspend(struct device *dev)
 {
 	struct cdns_dsi *dsi = dev_get_drvdata(dev);
 
Signature · 6 lines
2.17.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Building the driver in a configuration with !PM currently causes a warning about these operations being unused. Mark them as such to shut up the compiler.

I'd so love if we could use LTO (or at least link time garbage collection of functions/heap allocations) instead of tons of #ifdef (even in macros) and __maybe_unused.

Patch looks fine itself.

Quoted 33 lines
---
 drivers/gpu/drm/bridge/cdns-dsi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/cdns-dsi.c +2 -2
index c255fc3e1be5..f2d43f24acfb 100644
@@ -1337,7 +1337,7 @@ static const struct mipi_dsi_host_ops cdns_dsi_ops = {
 	.transfer = cdns_dsi_transfer,
 };
 
-static int cdns_dsi_resume(struct device *dev)
+static int __maybe_unused cdns_dsi_resume(struct device *dev)
 {
 	struct cdns_dsi *dsi = dev_get_drvdata(dev);
 
@@ -1350,7 +1350,7 @@ static int cdns_dsi_resume(struct device *dev)
 	return 0;
 }
 
-static int cdns_dsi_suspend(struct device *dev)
+static int __maybe_unused cdns_dsi_suspend(struct device *dev)
 {
 	struct cdns_dsi *dsi = dev_get_drvdata(dev);
 
Signature · 6 lines
2.17.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author Applied
#2 lore raw
Quoted 7 lines · Daniel Vetter
Quoted 6 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Building the driver in a configuration with !PM currently causes a warning about these operations being unused. Mark them as such to shut up the compiler.

Quoted 5 lines
Quoted 1 line

I'd so love if we could use LTO (or at least link time garbage collection of functions/heap allocations) instead of tons of #ifdef (even in macros) and __maybe_unused.

I had discussed this with Arnd Bergmann a long time ago and neither of us could figure out a way to make that work in this case, so we agreed that __maybe_unused was the preferred way forward until somebody would figure out a better way.

Quoted 3 lines

Patch looks fine itself.

Thanks, applied to drm-misc-next.

Thierry

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel