* [PATCH] usb: dwc3: pci: constify dev_pm_ops structures.
@ 2017-06-29 5:27 Arvind Yadav
0 siblings, 0 replies; only message in thread
From: Arvind Yadav @ 2017-06-29 5:27 UTC (permalink / raw)
To: balbi, gregkh; +Cc: linux-usb, linux-kernel
dev_pm_ops are not supposed to change at runtime. All functions
working with dev_pm_ops provided by <linux/device.h> work with const
dev_pm_ops. So mark the non-const structs as const.
File size before:
text data bss dec hex filename
2707 456 0 3163 c5b drivers/usb/dwc3/dwc3-pci.o
File size After adding 'const':
text data bss dec hex filename
2899 264 0 3163 c5b drivers/usb/dwc3/dwc3-pci.o
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/usb/dwc3/dwc3-pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index a15ec71..9b0fb05 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -342,7 +342,7 @@ static int dwc3_pci_resume(struct device *dev)
}
#endif /* CONFIG_PM_SLEEP */
-static struct dev_pm_ops dwc3_pci_dev_pm_ops = {
+static const struct dev_pm_ops dwc3_pci_dev_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(dwc3_pci_suspend, dwc3_pci_resume)
SET_RUNTIME_PM_OPS(dwc3_pci_runtime_suspend, dwc3_pci_runtime_resume,
NULL)
--
1.9.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-29 5:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-29 5:27 [PATCH] usb: dwc3: pci: constify dev_pm_ops structures Arvind Yadav
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.