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


Groups > linux.kernel > #1712049 > unrolled thread

[RFT 00/13] constify s390 ccw_device_id

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-08-15 12:40 +0200
Last post2017-08-15 13:40 +0200
Articles 12 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [RFT 00/13] constify s390 ccw_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-15 12:40 +0200
    [RFT 04/13] s390: con3215: constify ccw_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-15 12:40 +0200
    [RFT 08/13] s390: vmur: constify ccw_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-15 12:40 +0200
    [RFT 09/13] s390: ctcm: constify ccw_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-15 12:40 +0200
    [RFT 12/13] s390: zfcp: constify ccw_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-15 12:40 +0200
    [RFT 03/13] s390: dasd_fba: constify ccw_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-15 12:40 +0200
    [RFT 13/13] s390: virtio: constify ccw_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-15 12:40 +0200
      Re: [RFT 13/13] s390: virtio: constify ccw_device_id Cornelia Huck <cohuck@redhat.com> - 2017-08-15 13:20 +0200
    [RFT 02/13] s390: dasd_eckd: constify ccw_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-15 12:40 +0200
    [RFT 01/13] s390: ccwdev: constify ccw_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-15 12:40 +0200
    [RFT 07/13] s390: tape_3590: constify ccw_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-15 12:40 +0200
    Re: [RFT 00/13] constify s390 ccw_device_id Heiko Carstens <heiko.carstens@de.ibm.com> - 2017-08-15 13:40 +0200

#1712049 — [RFT 00/13] constify s390 ccw_device_id

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-15 12:40 +0200
Subject[RFT 00/13] constify s390 ccw_device_id
Message-ID<ueHqp-8q-3@gated-at.bofh.it>
ccw_device_id are not supposed to change at runtime. All functions
working with ccw_device_id provided by <asm/ccwdev.h> work with
const ccw_device_id. So mark ccw_device_id member of struct ccw driver
as const. And change all driver relatively.

Arvind Yadav (13):
  [RFT 01/13] s390: ccwdev: constify ccw_device_id
  [RFT 02/13] s390: dasd_eckd: constify ccw_device_id
  [RFT 03/13] s390: dasd_fba: constify ccw_device_id
  [RFT 04/13] s390: con3215: constify ccw_device_id
  [RFT 05/13] s390: raw3270: constify ccw_device_id
  [RFT 06/13] s390: tape_34xx: constify ccw_device_id
  [RFT 07/13] s390: tape_3590: constify ccw_device_id
  [RFT 08/13] s390: vmur: constify ccw_device_id
  [RFT 09/13] s390: ctcm: constify ccw_device_id
  [RFT 10/13] s390: lcs: constify ccw_device_id
  [RFT 11/13] s390: qeth: constify ccw_device_id
  [RFT 12/13] s390: zfcp: constify ccw_device_id
  [RFT 13/13] s390: virtio: constify ccw_device_id

 arch/s390/include/asm/ccwdev.h    | 2 +-
 drivers/s390/block/dasd_eckd.c    | 2 +-
 drivers/s390/block/dasd_fba.c     | 2 +-
 drivers/s390/char/con3215.c       | 2 +-
 drivers/s390/char/raw3270.c       | 2 +-
 drivers/s390/char/tape_34xx.c     | 2 +-
 drivers/s390/char/tape_3590.c     | 2 +-
 drivers/s390/char/vmur.c          | 2 +-
 drivers/s390/net/ctcm_main.c      | 2 +-
 drivers/s390/net/lcs.c            | 2 +-
 drivers/s390/net/qeth_core_main.c | 2 +-
 drivers/s390/scsi/zfcp_ccw.c      | 2 +-
 drivers/s390/virtio/virtio_ccw.c  | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

-- 
2.7.4

[toc] | [next] | [standalone]


#1712050 — [RFT 04/13] s390: con3215: constify ccw_device_id

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-15 12:40 +0200
Subject[RFT 04/13] s390: con3215: constify ccw_device_id
Message-ID<ueHqp-8q-13@gated-at.bofh.it>
In reply to#1712049
ccw_device_id are not supposed to change at runtime. All functions
working with ccw_device_id provided by <asm/ccwdev.h> work with
const ccw_device_id. So mark the non-const structs as const.

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

diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
index 9ec4ae0..632874d 100644
--- a/drivers/s390/char/con3215.c
+++ b/drivers/s390/char/con3215.c
@@ -791,7 +791,7 @@ static int raw3215_pm_start(struct ccw_device *cdev)
 	return 0;
 }
 
-static struct ccw_device_id raw3215_id[] = {
+static const struct ccw_device_id raw3215_id[] = {
 	{ CCW_DEVICE(0x3215, 0) },
 	{ /* end of list */ },
 };
-- 
2.7.4

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


#1712052 — [RFT 08/13] s390: vmur: constify ccw_device_id

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-15 12:40 +0200
Subject[RFT 08/13] s390: vmur: constify ccw_device_id
Message-ID<ueHqq-8q-17@gated-at.bofh.it>
In reply to#1712049
ccw_device_id are not supposed to change at runtime. All functions
working with ccw_device_id provided by <asm/ccwdev.h> work with
const ccw_device_id. So mark the non-const structs as const.

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

diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c
index 04aceb6..3d0cf06 100644
--- a/drivers/s390/char/vmur.c
+++ b/drivers/s390/char/vmur.c
@@ -49,7 +49,7 @@ static struct class *vmur_class;
 static struct debug_info *vmur_dbf;
 
 /* We put the device's record length (for writes) in the driver_info field */
-static struct ccw_device_id ur_ids[] = {
+static const struct ccw_device_id ur_ids[] = {
 	{ CCWDEV_CU_DI(READER_PUNCH_DEVTYPE, 80) },
 	{ CCWDEV_CU_DI(PRINTER_DEVTYPE, 132) },
 	{ /* end of list */ }
-- 
2.7.4

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


#1712053 — [RFT 09/13] s390: ctcm: constify ccw_device_id

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-15 12:40 +0200
Subject[RFT 09/13] s390: ctcm: constify ccw_device_id
Message-ID<ueHqq-8q-21@gated-at.bofh.it>
In reply to#1712049
ccw_device_id are not supposed to change at runtime. All functions
working with ccw_device_id provided by <asm/ccwdev.h> work with
const ccw_device_id. So mark the non-const structs as const.

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

diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c
index 1563b14..fb26206 100644
--- a/drivers/s390/net/ctcm_main.c
+++ b/drivers/s390/net/ctcm_main.c
@@ -1737,7 +1737,7 @@ static int ctcm_pm_resume(struct ccwgroup_device *gdev)
 	return rc;
 }
 
-static struct ccw_device_id ctcm_ids[] = {
+static const struct ccw_device_id ctcm_ids[] = {
 	{CCW_DEVICE(0x3088, 0x08), .driver_info = ctcm_channel_type_parallel},
 	{CCW_DEVICE(0x3088, 0x1e), .driver_info = ctcm_channel_type_ficon},
 	{CCW_DEVICE(0x3088, 0x1f), .driver_info = ctcm_channel_type_escon},
-- 
2.7.4

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


#1712054 — [RFT 12/13] s390: zfcp: constify ccw_device_id

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-15 12:40 +0200
Subject[RFT 12/13] s390: zfcp: constify ccw_device_id
Message-ID<ueHqq-8q-19@gated-at.bofh.it>
In reply to#1712049
ccw_device_id are not supposed to change at runtime. All functions
working with ccw_device_id provided by <asm/ccwdev.h> work with
const ccw_device_id. So mark the non-const structs as const.

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

diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c
index 54c7b48..af45d67 100644
--- a/drivers/s390/scsi/zfcp_ccw.c
+++ b/drivers/s390/scsi/zfcp_ccw.c
@@ -78,7 +78,7 @@ static int zfcp_ccw_activate(struct ccw_device *cdev, int clear, char *tag)
 	return 0;
 }
 
-static struct ccw_device_id zfcp_ccw_device_id[] = {
+static const struct ccw_device_id zfcp_ccw_device_id[] = {
 	{ CCW_DEVICE_DEVTYPE(0x1731, 0x3, 0x1732, 0x3) },
 	{ CCW_DEVICE_DEVTYPE(0x1731, 0x3, 0x1732, ZFCP_MODEL_PRIV) },
 	{},
-- 
2.7.4

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


#1712055 — [RFT 03/13] s390: dasd_fba: constify ccw_device_id

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-15 12:40 +0200
Subject[RFT 03/13] s390: dasd_fba: constify ccw_device_id
Message-ID<ueHqq-8q-23@gated-at.bofh.it>
In reply to#1712049
ccw_device_id are not supposed to change at runtime. All functions
working with ccw_device_id provided by <asm/ccwdev.h> work with
const ccw_device_id. So mark the non-const structs as const.

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

diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c
index 462cab5..2f7c044 100644
--- a/drivers/s390/block/dasd_fba.c
+++ b/drivers/s390/block/dasd_fba.c
@@ -44,7 +44,7 @@ struct dasd_fba_private {
 	struct dasd_fba_characteristics rdc_data;
 };
 
-static struct ccw_device_id dasd_fba_ids[] = {
+static const struct ccw_device_id dasd_fba_ids[] = {
 	{ CCW_DEVICE_DEVTYPE (0x6310, 0, 0x9336, 0), .driver_info = 0x1},
 	{ CCW_DEVICE_DEVTYPE (0x3880, 0, 0x3370, 0), .driver_info = 0x2},
 	{ /* end of list */ },
-- 
2.7.4

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


#1712056 — [RFT 13/13] s390: virtio: constify ccw_device_id

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-15 12:40 +0200
Subject[RFT 13/13] s390: virtio: constify ccw_device_id
Message-ID<ueHqq-8q-25@gated-at.bofh.it>
In reply to#1712049
ccw_device_id are not supposed to change at runtime. All functions
working with ccw_device_id provided by <asm/ccwdev.h> work with
const ccw_device_id. So mark the non-const structs as const.

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

diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c
index b18fe20..b43dbba 100644
--- a/drivers/s390/virtio/virtio_ccw.c
+++ b/drivers/s390/virtio/virtio_ccw.c
@@ -1307,7 +1307,7 @@ static int virtio_ccw_cio_notify(struct ccw_device *cdev, int event)
 	return rc;
 }
 
-static struct ccw_device_id virtio_ids[] = {
+static const struct ccw_device_id virtio_ids[] = {
 	{ CCW_DEVICE(0x3832, 0) },
 	{},
 };
-- 
2.7.4

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


#1712083 — Re: [RFT 13/13] s390: virtio: constify ccw_device_id

FromCornelia Huck <cohuck@redhat.com>
Date2017-08-15 13:20 +0200
SubjectRe: [RFT 13/13] s390: virtio: constify ccw_device_id
Message-ID<ueI38-An-17@gated-at.bofh.it>
In reply to#1712056
On Tue, 15 Aug 2017 16:05:44 +0530
Arvind Yadav <arvind.yadav.cs@gmail.com> wrote:

> ccw_device_id are not supposed to change at runtime. All functions
> working with ccw_device_id provided by <asm/ccwdev.h> work with
> const ccw_device_id. So mark the non-const structs as const.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
>  drivers/s390/virtio/virtio_ccw.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c
> index b18fe20..b43dbba 100644
> --- a/drivers/s390/virtio/virtio_ccw.c
> +++ b/drivers/s390/virtio/virtio_ccw.c
> @@ -1307,7 +1307,7 @@ static int virtio_ccw_cio_notify(struct ccw_device *cdev, int event)
>  	return rc;
>  }
>  
> -static struct ccw_device_id virtio_ids[] = {
> +static const struct ccw_device_id virtio_ids[] = {
>  	{ CCW_DEVICE(0x3832, 0) },
>  	{},
>  };

Acked-by: Cornelia Huck <cohuck@redhat.com>

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


#1712057 — [RFT 02/13] s390: dasd_eckd: constify ccw_device_id

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-15 12:40 +0200
Subject[RFT 02/13] s390: dasd_eckd: constify ccw_device_id
Message-ID<ueHqq-8q-27@gated-at.bofh.it>
In reply to#1712049
ccw_device_id are not supposed to change at runtime. All functions
working with ccw_device_id provided by <asm/ccwdev.h> work with
const ccw_device_id. So mark the non-const structs as const.

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

diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index c3e5ad6..40e7078 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -70,7 +70,7 @@ static struct dasd_discipline dasd_eckd_discipline;
 
 /* The ccw bus type uses this table to find devices that it sends to
  * dasd_eckd_probe */
-static struct ccw_device_id dasd_eckd_ids[] = {
+static const struct ccw_device_id dasd_eckd_ids[] = {
 	{ CCW_DEVICE_DEVTYPE (0x3990, 0, 0x3390, 0), .driver_info = 0x1},
 	{ CCW_DEVICE_DEVTYPE (0x2105, 0, 0x3390, 0), .driver_info = 0x2},
 	{ CCW_DEVICE_DEVTYPE (0x3880, 0, 0x3380, 0), .driver_info = 0x3},
-- 
2.7.4

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


#1712058 — [RFT 01/13] s390: ccwdev: constify ccw_device_id

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-15 12:40 +0200
Subject[RFT 01/13] s390: ccwdev: constify ccw_device_id
Message-ID<ueHqq-8q-31@gated-at.bofh.it>
In reply to#1712049
ccw_device_id are not supposed to change at runtime. AlL functions
working with ccw_device_id provided by <asm/ccwdev.h> work with
const ccw_device_id. So mark ccw_device_id as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 arch/s390/include/asm/ccwdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/s390/include/asm/ccwdev.h b/arch/s390/include/asm/ccwdev.h
index b80e456..d5c7af2 100644
--- a/arch/s390/include/asm/ccwdev.h
+++ b/arch/s390/include/asm/ccwdev.h
@@ -132,7 +132,7 @@ enum uc_todo {
  * @int_class: interruption class to use for accounting interrupts
  */
 struct ccw_driver {
-	struct ccw_device_id *ids;
+	const struct ccw_device_id *ids;
 	int (*probe) (struct ccw_device *);
 	void (*remove) (struct ccw_device *);
 	int (*set_online) (struct ccw_device *);
-- 
2.7.4

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


#1712059 — [RFT 07/13] s390: tape_3590: constify ccw_device_id

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-15 12:40 +0200
Subject[RFT 07/13] s390: tape_3590: constify ccw_device_id
Message-ID<ueHqq-8q-29@gated-at.bofh.it>
In reply to#1712049
ccw_device_id are not supposed to change at runtime. All functions
working with ccw_device_id provided by <asm/ccwdev.h> work with
const ccw_device_id. So mark the non-const structs as const.

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

diff --git a/drivers/s390/char/tape_3590.c b/drivers/s390/char/tape_3590.c
index e352047..576949e 100644
--- a/drivers/s390/char/tape_3590.c
+++ b/drivers/s390/char/tape_3590.c
@@ -1627,7 +1627,7 @@ static struct tape_discipline tape_discipline_3590 = {
 	.mtop_array = tape_3590_mtop
 };
 
-static struct ccw_device_id tape_3590_ids[] = {
+static const struct ccw_device_id tape_3590_ids[] = {
 	{CCW_DEVICE_DEVTYPE(0x3590, 0, 0x3590, 0), .driver_info = tape_3590},
 	{CCW_DEVICE_DEVTYPE(0x3592, 0, 0x3592, 0), .driver_info = tape_3592},
 	{ /* end of list */ }
-- 
2.7.4

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


#1712100

FromHeiko Carstens <heiko.carstens@de.ibm.com>
Date2017-08-15 13:40 +0200
Message-ID<ueImu-Il-17@gated-at.bofh.it>
In reply to#1712049
On Tue, Aug 15, 2017 at 04:05:31PM +0530, Arvind Yadav wrote:
> ccw_device_id are not supposed to change at runtime. All functions
> working with ccw_device_id provided by <asm/ccwdev.h> work with
> const ccw_device_id. So mark ccw_device_id member of struct ccw driver
> as const. And change all driver relatively.
> 
> Arvind Yadav (13):
>   [RFT 01/13] s390: ccwdev: constify ccw_device_id
>   [RFT 02/13] s390: dasd_eckd: constify ccw_device_id
>   [RFT 03/13] s390: dasd_fba: constify ccw_device_id
>   [RFT 04/13] s390: con3215: constify ccw_device_id
>   [RFT 05/13] s390: raw3270: constify ccw_device_id
>   [RFT 06/13] s390: tape_34xx: constify ccw_device_id
>   [RFT 07/13] s390: tape_3590: constify ccw_device_id
>   [RFT 08/13] s390: vmur: constify ccw_device_id
>   [RFT 09/13] s390: ctcm: constify ccw_device_id
>   [RFT 10/13] s390: lcs: constify ccw_device_id
>   [RFT 11/13] s390: qeth: constify ccw_device_id
>   [RFT 12/13] s390: zfcp: constify ccw_device_id
>   [RFT 13/13] s390: virtio: constify ccw_device_id

Did the constify work reveal a single bug until now? This causes a lot of
code churn, and I'm failing to see an added value here.
In addition this is not worth splitting it into 13(!) patches.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web