[PATCH] scsi: ibmvscsi: constify dev_pm_ops structures.

Subsystems: ibm power virtual scsi device drivers, linux for powerpc (32-bit and 64-bit), scsi subsystem, the rest

STALE3325d

2 messages, 2 authors, 2017-06-29 · open the first message on its own page

[PATCH] scsi: ibmvscsi: constify dev_pm_ops structures.

From: Arvind Yadav <hidden>
Date: 2017-06-29 07:44:57

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
  17956	   1456	      8	  19420	   4bdc	drivers/scsi/ibmvscsi/ibmvscsi.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
  18164	   1264	      8	  19436	   4bec	drivers/scsi/ibmvscsi/ibmvscsi.o

Signed-off-by: Arvind Yadav <redacted>
---
 drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 1deb0a9..da22b36 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -2336,7 +2336,7 @@ static int ibmvscsi_resume(struct device *dev)
 };
 MODULE_DEVICE_TABLE(vio, ibmvscsi_device_table);
 
-static struct dev_pm_ops ibmvscsi_pm_ops = {
+static const struct dev_pm_ops ibmvscsi_pm_ops = {
 	.resume = ibmvscsi_resume
 };
 
-- 
1.9.1

Re: [PATCH] scsi: ibmvscsi: constify dev_pm_ops structures.

From: Tyrel Datwyler <hidden>
Date: 2017-06-29 22:38:43

On 06/29/2017 12:43 AM, Arvind Yadav wrote:
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
  17956	   1456	      8	  19420	   4bdc	drivers/scsi/ibmvscsi/ibmvscsi.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
  18164	   1264	      8	  19436	   4bec	drivers/scsi/ibmvscsi/ibmvscsi.o

Signed-off-by: Arvind Yadav <redacted>
Acked-by: Tyrel Datwyler <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help