Skip to contentSkip to conversation

usb: host: constify dev_pm_ops structures

PATCH New Bhumika Goyal 1 participant 1 message Jan 15, 2017

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

PATCH 1/1 usb: host: constify dev_pm_ops structures

Declare dev_pm_ops structures as const as they are only stored in the pm field of a device_driver structure. This field is of type const, so dev_pm_ops structures having similar properties can be declared const too.

Size details after cross compiling the .o file for powerpc architecture.

File size before:
text data bss dec hex filename
3183 372 0 3555 de3 drivers/usb/host/ehci-fsl.o

File size after:
text data bss dec hex filename
3275 280 0 3555 de3 drivers/usb/host/ehci-fsl.o

---
 drivers/usb/host/ehci-fsl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/ehci-fsl.c +1 -1
index 91701cc..3733aab 100644
@@ -600,7 +600,7 @@ static int ehci_fsl_drv_restore(struct device *dev)
 	return 0;
 }
 
-static struct dev_pm_ops ehci_fsl_pm_ops = {
+static const struct dev_pm_ops ehci_fsl_pm_ops = {
 	.suspend = ehci_fsl_drv_suspend,
 	.resume = ehci_fsl_drv_resume,
 	.restore = ehci_fsl_drv_restore,
Signature · 1 line
1.9.1