linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: ibmvfc: constify dev_pm_ops structures.
@ 2017-06-29  7:54 Arvind Yadav
  2017-06-29 22:39 ` Tyrel Datwyler
  2017-07-01 21:05 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Arvind Yadav @ 2017-06-29  7:54 UTC (permalink / raw)
  To: tyreld, benh, paulus, mpe, jejb, martin.petersen
  Cc: linux-scsi, linuxppc-dev, 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
  41937	   1296	     20	  43253	   a8f5	drivers/scsi/ibmvscsi/ibmvfc.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
  42129	   1104	     20	  43253	   a8f5	drivers/scsi/ibmvscsi/ibmvfc.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/scsi/ibmvscsi/ibmvfc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index 26cd3c2..cc4e05b 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -4935,7 +4935,7 @@ static unsigned long ibmvfc_get_desired_dma(struct vio_dev *vdev)
 };
 MODULE_DEVICE_TABLE(vio, ibmvfc_device_table);
 
-static struct dev_pm_ops ibmvfc_pm_ops = {
+static const struct dev_pm_ops ibmvfc_pm_ops = {
 	.resume = ibmvfc_resume
 };
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: ibmvfc: constify dev_pm_ops structures.
  2017-06-29  7:54 [PATCH] scsi: ibmvfc: constify dev_pm_ops structures Arvind Yadav
@ 2017-06-29 22:39 ` Tyrel Datwyler
  2017-07-01 21:05 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Tyrel Datwyler @ 2017-06-29 22:39 UTC (permalink / raw)
  To: Arvind Yadav, tyreld, benh, paulus, mpe, jejb, martin.petersen
  Cc: linux-scsi, linuxppc-dev, linux-kernel

On 06/29/2017 12:54 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
>   41937	   1296	     20	  43253	   a8f5	drivers/scsi/ibmvscsi/ibmvfc.o
> 
> File size After adding 'const':
>    text	   data	    bss	    dec	    hex	filename
>   42129	   1104	     20	  43253	   a8f5	drivers/scsi/ibmvscsi/ibmvfc.o
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

Acked-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: ibmvfc: constify dev_pm_ops structures.
  2017-06-29  7:54 [PATCH] scsi: ibmvfc: constify dev_pm_ops structures Arvind Yadav
  2017-06-29 22:39 ` Tyrel Datwyler
@ 2017-07-01 21:05 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2017-07-01 21:05 UTC (permalink / raw)
  To: Arvind Yadav
  Cc: tyreld, benh, paulus, mpe, jejb, martin.petersen, linux-scsi,
	linuxppc-dev, linux-kernel


Arvind,

> 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.

Applied to 4.13/scsi-queue. Thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-01 21:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-29  7:54 [PATCH] scsi: ibmvfc: constify dev_pm_ops structures Arvind Yadav
2017-06-29 22:39 ` Tyrel Datwyler
2017-07-01 21:05 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).