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

s390/cio: rename struct channel_path_desc

Rename struct channel_path_desc to struct channel_path_desc_fmt0
to fit the scheme. Provide a macro for the function wrappers that
gather this and related data from firmware.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Sebastian Ott and committed by
Martin Schwidefsky
ded27d8d 135a8b4c

+36 -50
+1 -1
arch/s390/include/asm/ccwdev.h
··· 230 230 231 231 extern void ccw_device_get_schid(struct ccw_device *, struct subchannel_id *); 232 232 233 - struct channel_path_desc *ccw_device_get_chp_desc(struct ccw_device *, int); 233 + struct channel_path_desc_fmt0 *ccw_device_get_chp_desc(struct ccw_device *, int); 234 234 #endif /* _S390_CCWDEV_H_ */
+1 -1
arch/s390/include/asm/chpid.h
··· 9 9 #include <uapi/asm/chpid.h> 10 10 #include <asm/cio.h> 11 11 12 - struct channel_path_desc { 12 + struct channel_path_desc_fmt0 { 13 13 u8 flags; 14 14 u8 lsn; 15 15 u8 desc;
+1 -1
drivers/s390/block/dasd_eckd.c
··· 994 994 struct dasd_eckd_private *private, path_private; 995 995 struct dasd_uid *uid; 996 996 char print_path_uid[60], print_device_uid[60]; 997 - struct channel_path_desc *chp_desc; 997 + struct channel_path_desc_fmt0 *chp_desc; 998 998 struct subchannel_id sch_id; 999 999 1000 1000 private = device->private;
+5 -5
drivers/s390/cio/chp.c
··· 422 422 { 423 423 int rc; 424 424 425 - rc = chsc_determine_base_channel_path_desc(chp->chpid, &chp->desc); 425 + rc = chsc_determine_fmt0_channel_path_desc(chp->chpid, &chp->desc); 426 426 if (rc) 427 427 return rc; 428 428 ··· 506 506 * On success return a newly allocated copy of the channel-path description 507 507 * data associated with the given channel-path ID. Return %NULL on error. 508 508 */ 509 - struct channel_path_desc *chp_get_chp_desc(struct chp_id chpid) 509 + struct channel_path_desc_fmt0 *chp_get_chp_desc(struct chp_id chpid) 510 510 { 511 511 struct channel_path *chp; 512 - struct channel_path_desc *desc; 512 + struct channel_path_desc_fmt0 *desc; 513 513 514 514 chp = chpid_to_chp(chpid); 515 515 if (!chp) 516 516 return NULL; 517 - desc = kmalloc(sizeof(struct channel_path_desc), GFP_KERNEL); 517 + desc = kmalloc(sizeof(*desc), GFP_KERNEL); 518 518 if (!desc) 519 519 return NULL; 520 520 521 521 mutex_lock(&chp->lock); 522 - memcpy(desc, &chp->desc, sizeof(struct channel_path_desc)); 522 + memcpy(desc, &chp->desc, sizeof(*desc)); 523 523 mutex_unlock(&chp->lock); 524 524 return desc; 525 525 }
+2 -2
drivers/s390/cio/chp.h
··· 44 44 struct chp_id chpid; 45 45 struct mutex lock; /* Serialize access to below members. */ 46 46 int state; 47 - struct channel_path_desc desc; 47 + struct channel_path_desc_fmt0 desc; 48 48 struct channel_path_desc_fmt1 desc_fmt1; 49 49 /* Channel-measurement related stuff: */ 50 50 int cmg; ··· 61 61 int chp_get_status(struct chp_id chpid); 62 62 u8 chp_get_sch_opm(struct subchannel *sch); 63 63 int chp_is_registered(struct chp_id chpid); 64 - struct channel_path_desc *chp_get_chp_desc(struct chp_id chpid); 64 + struct channel_path_desc_fmt0 *chp_get_chp_desc(struct chp_id chpid); 65 65 void chp_remove_cmg_attr(struct channel_path *chp); 66 66 int chp_add_cmg_attr(struct channel_path *chp); 67 67 int chp_update_desc(struct channel_path *chp);
+21 -35
drivers/s390/cio/chsc.c
··· 940 940 } 941 941 EXPORT_SYMBOL_GPL(chsc_determine_channel_path_desc); 942 942 943 - int chsc_determine_base_channel_path_desc(struct chp_id chpid, 944 - struct channel_path_desc *desc) 945 - { 946 - struct chsc_scpd *scpd_area; 947 - unsigned long flags; 948 - int ret; 949 - 950 - spin_lock_irqsave(&chsc_page_lock, flags); 951 - scpd_area = chsc_page; 952 - ret = chsc_determine_channel_path_desc(chpid, 0, 0, 0, 0, scpd_area); 953 - if (ret) 954 - goto out; 955 - 956 - memcpy(desc, scpd_area->data, sizeof(*desc)); 957 - out: 958 - spin_unlock_irqrestore(&chsc_page_lock, flags); 959 - return ret; 943 + #define chsc_det_chp_desc(FMT, c) \ 944 + int chsc_determine_fmt##FMT##_channel_path_desc( \ 945 + struct chp_id chpid, struct channel_path_desc_fmt##FMT *desc) \ 946 + { \ 947 + struct chsc_scpd *scpd_area; \ 948 + unsigned long flags; \ 949 + int ret; \ 950 + \ 951 + spin_lock_irqsave(&chsc_page_lock, flags); \ 952 + scpd_area = chsc_page; \ 953 + ret = chsc_determine_channel_path_desc(chpid, 0, FMT, c, 0, \ 954 + scpd_area); \ 955 + if (ret) \ 956 + goto out; \ 957 + \ 958 + memcpy(desc, scpd_area->data, sizeof(*desc)); \ 959 + out: \ 960 + spin_unlock_irqrestore(&chsc_page_lock, flags); \ 961 + return ret; \ 960 962 } 961 963 962 - int chsc_determine_fmt1_channel_path_desc(struct chp_id chpid, 963 - struct channel_path_desc_fmt1 *desc) 964 - { 965 - struct chsc_scpd *scpd_area; 966 - unsigned long flags; 967 - int ret; 968 - 969 - spin_lock_irqsave(&chsc_page_lock, flags); 970 - scpd_area = chsc_page; 971 - ret = chsc_determine_channel_path_desc(chpid, 0, 1, 1, 0, scpd_area); 972 - if (ret) 973 - goto out; 974 - 975 - memcpy(desc, scpd_area->data, sizeof(*desc)); 976 - out: 977 - spin_unlock_irqrestore(&chsc_page_lock, flags); 978 - return ret; 979 - } 964 + chsc_det_chp_desc(0, 0) 965 + chsc_det_chp_desc(1, 1) 980 966 981 967 static void 982 968 chsc_initialize_cmg_chars(struct channel_path *chp, u8 cmcv,
+2 -2
drivers/s390/cio/chsc.h
··· 147 147 int chsc_chp_vary(struct chp_id chpid, int on); 148 148 int chsc_determine_channel_path_desc(struct chp_id chpid, int fmt, int rfmt, 149 149 int c, int m, void *page); 150 - int chsc_determine_base_channel_path_desc(struct chp_id chpid, 151 - struct channel_path_desc *desc); 150 + int chsc_determine_fmt0_channel_path_desc(struct chp_id chpid, 151 + struct channel_path_desc_fmt0 *desc); 152 152 int chsc_determine_fmt1_channel_path_desc(struct chp_id chpid, 153 153 struct channel_path_desc_fmt1 *desc); 154 154 void chsc_chp_online(struct chp_id chpid);
+2 -2
drivers/s390/cio/device_ops.c
··· 460 460 * On success return a newly allocated copy of the channel-path description 461 461 * data associated with the given channel path. Return %NULL on error. 462 462 */ 463 - struct channel_path_desc *ccw_device_get_chp_desc(struct ccw_device *cdev, 464 - int chp_idx) 463 + struct channel_path_desc_fmt0 *ccw_device_get_chp_desc(struct ccw_device *cdev, 464 + int chp_idx) 465 465 { 466 466 struct subchannel *sch; 467 467 struct chp_id chpid;
+1 -1
drivers/s390/net/qeth_core_main.c
··· 1361 1361 static void qeth_update_from_chp_desc(struct qeth_card *card) 1362 1362 { 1363 1363 struct ccw_device *ccwdev; 1364 - struct channel_path_desc *chp_dsc; 1364 + struct channel_path_desc_fmt0 *chp_dsc; 1365 1365 1366 1366 QETH_DBF_TEXT(SETUP, 2, "chp_desc"); 1367 1367