constify s390 ccw_device_id
Subsystems (6)
cover constify s390 ccw_device_id
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(-)
Signature · 1 line
2.7.4
PATCH 1/13 s390: ccwdev: constify ccw_device_id
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.
--- arch/s390/include/asm/ccwdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/include/asm/ccwdev.h +1 -1
@@ -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 *);
Signature · 1 line
2.7.4
PATCH 2/13 s390: dasd_eckd: constify ccw_device_id
In reply to Arvind Yadavccw_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.
--- drivers/s390/block/dasd_eckd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/block/dasd_eckd.c +1 -1
@@ -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 },
Signature · 1 line
2.7.4
PATCH 3/13 s390: dasd_fba: constify ccw_device_id
In reply to Arvind Yadavccw_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.
--- drivers/s390/block/dasd_fba.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/block/dasd_fba.c +1 -1
@@ -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 */ },
Signature · 1 line
2.7.4
PATCH 4/13 s390: con3215: constify ccw_device_id
In reply to Arvind Yadavccw_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.
--- drivers/s390/char/con3215.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/char/con3215.c +1 -1
@@ -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 */ }, };
Signature · 1 line
2.7.4
PATCH 5/13 s390: raw3270: constify ccw_device_id
In reply to Arvind Yadavccw_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.
--- drivers/s390/char/raw3270.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/char/raw3270.c +1 -1
@@ -1267,7 +1267,7 @@ void raw3270_pm_unfreeze(struct raw3270_view *view)#endif } -static struct ccw_device_id raw3270_id[] = { +static const struct ccw_device_id raw3270_id[] = { {CCW_DEVICE (0x3270 ,0 ) }, {CCW_DEVICE (0x3271 ,0 ) }, {CCW_DEVICE (0x3272 ,0 ) },
Signature · 1 line
2.7.4
PATCH 6/13 s390: tape_34xx: constify ccw_device_id
In reply to Arvind Yadavccw_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.
--- drivers/s390/char/tape_34xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/char/tape_34xx.c +1 -1
@@ -1165,7 +1165,7 @@ static struct tape_discipline tape_discipline_34xx = { .mtop_array = tape_34xx_mtop }; -static struct ccw_device_id tape_34xx_ids[] = { +static const struct ccw_device_id tape_34xx_ids[] = { {CCW_DEVICE_DEVTYPE (0x3480 ,0 ,0x3480 ,0 ), .driver_info = tape_3480}, {CCW_DEVICE_DEVTYPE (0x3490 ,0 ,0x3490 ,0 ), .driver_info = tape_3490}, {/* end of list */ },
Signature · 1 line
2.7.4
PATCH 7/13 s390: tape_3590: constify ccw_device_id
In reply to Arvind Yadavccw_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.
--- drivers/s390/char/tape_3590.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/char/tape_3590.c +1 -1
@@ -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 */ }
Signature · 1 line
2.7.4
PATCH 8/13 s390: vmur: constify ccw_device_id
In reply to Arvind Yadavccw_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.
--- drivers/s390/char/vmur.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/char/vmur.c +1 -1
@@ -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 */ }
Signature · 1 line
2.7.4
PATCH 9/13 s390: ctcm: constify ccw_device_id
In reply to Arvind Yadavccw_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.
--- drivers/s390/net/ctcm_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/net/ctcm_main.c +1 -1
@@ -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},
Signature · 1 line
2.7.4
PATCH 10/13 s390: lcs: constify ccw_device_id
In reply to Arvind Yadavccw_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.
--- drivers/s390/net/lcs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/net/lcs.c +1 -1
@@ -2373,7 +2373,7 @@ static int lcs_restore(struct ccwgroup_device *gdev)return lcs_pm_resume (card); } -static struct ccw_device_id lcs_ids[] = { +static const struct ccw_device_id lcs_ids[] = { {CCW_DEVICE (0x3088 ,0x08 ), .driver_info = lcs_channel_type_parallel}, {CCW_DEVICE (0x3088 ,0x1f ), .driver_info = lcs_channel_type_2216}, {CCW_DEVICE (0x3088 ,0x60 ), .driver_info = lcs_channel_type_osa2},
Signature · 1 line
2.7.4
PATCH 11/13 s390: qeth: constify ccw_device_id
In reply to Arvind Yadavccw_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.
--- drivers/s390/net/qeth_core_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/net/qeth_core_main.c +1 -1
@@ -5053,7 +5053,7 @@ void qeth_trace_features(struct qeth_card *card) }EXPORT_SYMBOL_GPL (qeth_trace_features); -static struct ccw_device_id qeth_ids[] = { +static const struct ccw_device_id qeth_ids[] = { {CCW_DEVICE_DEVTYPE (0x1731 ,0x01 ,0x1732 ,0x01 ), .driver_info =QETH_CARD_TYPE_OSD }, {CCW_DEVICE_DEVTYPE (0x1731 ,0x05 ,0x1732 ,0x05 ),
Signature · 1 line
2.7.4
PATCH 12/13 s390: zfcp: constify ccw_device_id
In reply to Arvind Yadavccw_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.
--- drivers/s390/scsi/zfcp_ccw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/scsi/zfcp_ccw.c +1 -1
@@ -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 ) }, {},
Signature · 1 line
2.7.4
PATCH 13/13 s390: virtio: constify ccw_device_id
In reply to Arvind Yadavccw_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.
--- drivers/s390/virtio/virtio_ccw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/virtio/virtio_ccw.c +1 -1
@@ -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 ) }, {}, };
Signature · 1 line
2.7.4
Re: [RFT 13/13] s390: virtio: constify ccw_device_id
Quoted 14 lines · On Tue, 15 Aug 2017 16:05:44 +0530 Arvind Yadav <[email protected]>…
ccw_device_idare not supposed to change at runtime. All functions working withccw_device_idprovided by <asm/ccwdev.h> work with constccw_device_id. So mark the non-const structs as const.Signed-off-by Arvind Yadav <[email protected]>--- drivers/s390/virtio/virtio_ccw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/s390/virtio/virtio_ccw.c +0
-0
drivers/s390/virtio/virtio_ccw.c static int virtio_ccw_cio_notify(struct ccw_device *cdev, int event) · line 1313
Quoted 8 lines
drivers/s390/virtio/virtio_ccw.c +1
-1@@ -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 ) }, {}, };
Quoted 5 lines · Arvind Yadav
ccw_device_idare not supposed to change at runtime. All functions working withccw_device_idprovided by <asm/ccwdev.h> work with constccw_device_id. So markccw_device_idmember of struct ccw driver as const. And change all driver relatively.
Quoted 14 lines
Arvind Yadav (13):
[RFT 01/13] s390: ccwdev: constifyccw_device_id[RFT 02/13] s390:dasd_eckd: constifyccw_device_id[RFT 03/13] s390:dasd_fba: constifyccw_device_id[RFT 04/13] s390: con3215: constifyccw_device_id[RFT 05/13] s390: raw3270: constifyccw_device_id[RFT 06/13] s390:tape_34xx: constifyccw_device_id[RFT 07/13] s390:tape_3590: constifyccw_device_id[RFT 08/13] s390: vmur: constifyccw_device_id[RFT 09/13] s390: ctcm: constifyccw_device_id[RFT 10/13] s390: lcs: constifyccw_device_id[RFT 11/13] s390: qeth: constifyccw_device_id[RFT 12/13] s390: zfcp: constifyccw_device_id[RFT 13/13] s390: virtio: constifyccw_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.