i2c: busses: constify dev_pm_ops structures
Subsystems (4)
PATCH 1/1 i2c: busses: 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.
File size before: drivers/i2c/busses/i2c-omap.o
text data bss dec hex filename
6814 584 0 7398 1ce6 drivers/i2c/busses/i2c-omap.o
File size after: drivers/i2c/busses/i2c-omap.o
text data bss dec hex filename
7006 392 0 7398 1ce6 drivers/i2c/busses/i2c-omap.o
--- drivers/i2c/busses/i2c-omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-omap.c +1 -1
@@ -1504,7 +1504,7 @@ static int omap_i2c_runtime_resume(struct device *dev)return 0 ; } -static struct dev_pm_ops omap_i2c_pm_ops = { +static const struct dev_pm_ops omap_i2c_pm_ops = {SET_RUNTIME_PM_OPS (omap_i2c_runtime_suspend, omap_i2c_runtime_resume,NULL ) };
Signature · 1 line
1.9.1
Quoted 9 lines · Bhumika Goyal
Declare
dev_pm_opsstructures as const as they are only stored in the pm field of adevice_driverstructure. This field is of type const, sodev_pm_opsstructures having similar properties can be declared const too.File size before:
drivers/i2c/busses/i2c-omap.o
text data bss dec hex filename
6814 584 0 7398 1ce6drivers/i2c/busses/i2c-omap.o
Quoted 5 lines
File size after:
drivers/i2c/busses/i2c-omap.o
text data bss dec hex filename
7006 392 0 7398 1ce6drivers/i2c/busses/i2c-omap.oSigned-off-by Bhumika Goyal <[email protected]>
Quoted 20 lines
--- drivers/i2c/busses/i2c-omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/i2c/busses/i2c-omap.c +1
-1@@ -1504,7 +1504,7 @@ static int omap_i2c_runtime_resume(struct device *dev)return 0 ; } -static struct dev_pm_ops omap_i2c_pm_ops = { +static const struct dev_pm_ops omap_i2c_pm_ops = {SET_RUNTIME_PM_OPS (omap_i2c_runtime_suspend, omap_i2c_runtime_resume,NULL ) };Signature · 1 line
1.9.1
Wolfram Sang
AppliedQuoted 9 lines · Bhumika Goyal
Declare
dev_pm_opsstructures as const as they are only stored in the pm field of adevice_driverstructure. This field is of type const, sodev_pm_opsstructures having similar properties can be declared const too.File size before:
drivers/i2c/busses/i2c-omap.o
text data bss dec hex filename
6814 584 0 7398 1ce6drivers/i2c/busses/i2c-omap.o
Quoted 5 lines
File size after:
drivers/i2c/busses/i2c-omap.o
text data bss dec hex filename
7006 392 0 7398 1ce6drivers/i2c/busses/i2c-omap.oSigned-off-by Bhumika Goyal <[email protected]>
Applied to for-next, thanks! I dropped the file size table from the commit message, though. For me, it is clear enough without it.