Skip to content

Commit ded27d8

Browse files
Sebastian OttMartin Schwidefsky
authored andcommitted
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 <[email protected]> Reviewed-by: Peter Oberparleiter <[email protected]> Signed-off-by: Martin Schwidefsky <[email protected]>
1 parent 135a8b4 commit ded27d8

File tree

9 files changed

+36
-50
lines changed

9 files changed

+36
-50
lines changed

arch/s390/include/asm/ccwdev.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,5 +230,5 @@ int ccw_device_siosl(struct ccw_device *);
230230

231231
extern void ccw_device_get_schid(struct ccw_device *, struct subchannel_id *);
232232

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);
234234
#endif /* _S390_CCWDEV_H_ */

arch/s390/include/asm/chpid.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <uapi/asm/chpid.h>
1010
#include <asm/cio.h>
1111

12-
struct channel_path_desc {
12+
struct channel_path_desc_fmt0 {
1313
u8 flags;
1414
u8 lsn;
1515
u8 desc;

drivers/s390/block/dasd_eckd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ static int dasd_eckd_read_conf(struct dasd_device *device)
994994
struct dasd_eckd_private *private, path_private;
995995
struct dasd_uid *uid;
996996
char print_path_uid[60], print_device_uid[60];
997-
struct channel_path_desc *chp_desc;
997+
struct channel_path_desc_fmt0 *chp_desc;
998998
struct subchannel_id sch_id;
999999

10001000
private = device->private;

drivers/s390/cio/chp.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ int chp_update_desc(struct channel_path *chp)
422422
{
423423
int rc;
424424

425-
rc = chsc_determine_base_channel_path_desc(chp->chpid, &chp->desc);
425+
rc = chsc_determine_fmt0_channel_path_desc(chp->chpid, &chp->desc);
426426
if (rc)
427427
return rc;
428428

@@ -506,20 +506,20 @@ int chp_new(struct chp_id chpid)
506506
* On success return a newly allocated copy of the channel-path description
507507
* data associated with the given channel-path ID. Return %NULL on error.
508508
*/
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)
510510
{
511511
struct channel_path *chp;
512-
struct channel_path_desc *desc;
512+
struct channel_path_desc_fmt0 *desc;
513513

514514
chp = chpid_to_chp(chpid);
515515
if (!chp)
516516
return NULL;
517-
desc = kmalloc(sizeof(struct channel_path_desc), GFP_KERNEL);
517+
desc = kmalloc(sizeof(*desc), GFP_KERNEL);
518518
if (!desc)
519519
return NULL;
520520

521521
mutex_lock(&chp->lock);
522-
memcpy(desc, &chp->desc, sizeof(struct channel_path_desc));
522+
memcpy(desc, &chp->desc, sizeof(*desc));
523523
mutex_unlock(&chp->lock);
524524
return desc;
525525
}

drivers/s390/cio/chp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct channel_path {
4444
struct chp_id chpid;
4545
struct mutex lock; /* Serialize access to below members. */
4646
int state;
47-
struct channel_path_desc desc;
47+
struct channel_path_desc_fmt0 desc;
4848
struct channel_path_desc_fmt1 desc_fmt1;
4949
/* Channel-measurement related stuff: */
5050
int cmg;
@@ -61,7 +61,7 @@ static inline struct channel_path *chpid_to_chp(struct chp_id chpid)
6161
int chp_get_status(struct chp_id chpid);
6262
u8 chp_get_sch_opm(struct subchannel *sch);
6363
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);
6565
void chp_remove_cmg_attr(struct channel_path *chp);
6666
int chp_add_cmg_attr(struct channel_path *chp);
6767
int chp_update_desc(struct channel_path *chp);

drivers/s390/cio/chsc.c

Lines changed: 21 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -940,43 +940,29 @@ int chsc_determine_channel_path_desc(struct chp_id chpid, int fmt, int rfmt,
940940
}
941941
EXPORT_SYMBOL_GPL(chsc_determine_channel_path_desc);
942942

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; \
960962
}
961963

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)
980966

981967
static void
982968
chsc_initialize_cmg_chars(struct channel_path *chp, u8 cmcv,

drivers/s390/cio/chsc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ int __chsc_do_secm(struct channel_subsystem *css, int enable);
147147
int chsc_chp_vary(struct chp_id chpid, int on);
148148
int chsc_determine_channel_path_desc(struct chp_id chpid, int fmt, int rfmt,
149149
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);
152152
int chsc_determine_fmt1_channel_path_desc(struct chp_id chpid,
153153
struct channel_path_desc_fmt1 *desc);
154154
void chsc_chp_online(struct chp_id chpid);

drivers/s390/cio/device_ops.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,8 @@ __u8 ccw_device_get_path_mask(struct ccw_device *cdev)
460460
* On success return a newly allocated copy of the channel-path description
461461
* data associated with the given channel path. Return %NULL on error.
462462
*/
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)
465465
{
466466
struct subchannel *sch;
467467
struct chp_id chpid;

drivers/s390/net/qeth_core_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ static void qeth_set_multiple_write_queues(struct qeth_card *card)
13611361
static void qeth_update_from_chp_desc(struct qeth_card *card)
13621362
{
13631363
struct ccw_device *ccwdev;
1364-
struct channel_path_desc *chp_dsc;
1364+
struct channel_path_desc_fmt0 *chp_dsc;
13651365

13661366
QETH_DBF_TEXT(SETUP, 2, "chp_desc");
13671367

0 commit comments

Comments
 (0)