Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1677505 > unrolled thread

[PATCH] scsi: ibmvfc: constify dev_pm_ops structures.

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-06-29 10:00 +0200
Last post2017-07-01 23:10 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] scsi: ibmvfc: constify dev_pm_ops structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-06-29 10:00 +0200
    Re: [PATCH] scsi: ibmvfc: constify dev_pm_ops structures. Tyrel Datwyler <tyreld@linux.vnet.ibm.com> - 2017-06-30 00:50 +0200
    Re: [PATCH] scsi: ibmvfc: constify dev_pm_ops structures. "Martin K. Petersen" <martin.petersen@oracle.com> - 2017-07-01 23:10 +0200

#1677505 — [PATCH] scsi: ibmvfc: constify dev_pm_ops structures.

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-06-29 10:00 +0200
Subject[PATCH] scsi: ibmvfc: constify dev_pm_ops structures.
Message-ID<tXCwP-4ON-27@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1678254

FromTyrel Datwyler <tyreld@linux.vnet.ibm.com>
Date2017-06-30 00:50 +0200
Message-ID<tXQq5-5sY-5@gated-at.bofh.it>
In reply to#1677505
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>

[toc] | [prev] | [next] | [standalone]


#1679402

From"Martin K. Petersen" <martin.petersen@oracle.com>
Date2017-07-01 23:10 +0200
Message-ID<tYxOp-6Z-3@gated-at.bofh.it>
In reply to#1677505
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web