Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/dasd: handle request magic consistently as unsigned int

Get rid of the rather odd casts to character pointer of the
dasd_ccw_req magic member and simply use the unsigned int value
unmodified everywhere.

Acked-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Link: https://lore.kernel.org/r/20211020115124.1735254-2-sth@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Heiko Carstens and committed by
Jens Axboe
169bbdac 0c98057b

+8 -8
+3 -3
drivers/s390/block/dasd_3990_erp.c
··· 201 201 struct ccw1 *ccw; 202 202 struct dasd_ccw_req *dctl_cqr; 203 203 204 - dctl_cqr = dasd_alloc_erp_request((char *) &erp->magic, 1, 204 + dctl_cqr = dasd_alloc_erp_request(erp->magic, 1, 205 205 sizeof(struct DCTL_data), 206 206 device); 207 207 if (IS_ERR(dctl_cqr)) { ··· 1652 1652 } 1653 1653 1654 1654 /* Build new ERP request including DE/LO */ 1655 - erp = dasd_alloc_erp_request((char *) &cqr->magic, 1655 + erp = dasd_alloc_erp_request(cqr->magic, 1656 1656 2 + 1,/* DE/LO + TIC */ 1657 1657 sizeof(struct DE_eckd_data) + 1658 1658 sizeof(struct LO_eckd_data), device); ··· 2388 2388 } 2389 2389 2390 2390 /* allocate additional request block */ 2391 - erp = dasd_alloc_erp_request((char *) &cqr->magic, 2391 + erp = dasd_alloc_erp_request(cqr->magic, 2392 2392 cplength, datasize, device); 2393 2393 if (IS_ERR(erp)) { 2394 2394 if (cqr->retries <= 0) {
+4 -4
drivers/s390/block/dasd_erp.c
··· 24 24 #include "dasd_int.h" 25 25 26 26 struct dasd_ccw_req * 27 - dasd_alloc_erp_request(char *magic, int cplength, int datasize, 27 + dasd_alloc_erp_request(unsigned int magic, int cplength, int datasize, 28 28 struct dasd_device * device) 29 29 { 30 30 unsigned long flags; ··· 33 33 int size; 34 34 35 35 /* Sanity checks */ 36 - BUG_ON( magic == NULL || datasize > PAGE_SIZE || 37 - (cplength*sizeof(struct ccw1)) > PAGE_SIZE); 36 + BUG_ON(datasize > PAGE_SIZE || 37 + (cplength*sizeof(struct ccw1)) > PAGE_SIZE); 38 38 39 39 size = (sizeof(struct dasd_ccw_req) + 7L) & -8L; 40 40 if (cplength > 0) ··· 62 62 cqr->data = data; 63 63 memset(cqr->data, 0, datasize); 64 64 } 65 - strncpy((char *) &cqr->magic, magic, 4); 65 + cqr->magic = magic; 66 66 ASCEBC((char *) &cqr->magic, 4); 67 67 set_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags); 68 68 dasd_get_device(device);
+1 -1
drivers/s390/block/dasd_int.h
··· 887 887 /* externals in dasd_erp.c */ 888 888 struct dasd_ccw_req *dasd_default_erp_action(struct dasd_ccw_req *); 889 889 struct dasd_ccw_req *dasd_default_erp_postaction(struct dasd_ccw_req *); 890 - struct dasd_ccw_req *dasd_alloc_erp_request(char *, int, int, 890 + struct dasd_ccw_req *dasd_alloc_erp_request(unsigned int, int, int, 891 891 struct dasd_device *); 892 892 void dasd_free_erp_request(struct dasd_ccw_req *, struct dasd_device *); 893 893 void dasd_log_sense(struct dasd_ccw_req *, struct irb *);