Skip to content

Commit 2bf29df

Browse files
Sebastian OttMartin Schwidefsky
authored andcommitted
s390/cio: fix multiple structure definitions
Fix multiple definitions of struct channel_path_desc by moving it to asm/chpid.h . Also change ccw_device_get_chp_desc to use proper types. Reviewed-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com> Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 2e4006b commit 2bf29df

File tree

7 files changed

+27
-26
lines changed

7 files changed

+27
-26
lines changed

arch/s390/include/asm/ccwdev.h

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

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

232-
extern void *ccw_device_get_chp_desc(struct ccw_device *, int);
232+
struct channel_path_desc *ccw_device_get_chp_desc(struct ccw_device *, int);
233233
#endif /* _S390_CCWDEV_H_ */

arch/s390/include/asm/chpid.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@
88
#include <uapi/asm/chpid.h>
99
#include <asm/cio.h>
1010

11+
struct channel_path_desc {
12+
u8 flags;
13+
u8 lsn;
14+
u8 desc;
15+
u8 chpid;
16+
u8 swla;
17+
u8 zeroes;
18+
u8 chla;
19+
u8 chpp;
20+
} __packed;
21+
1122
static inline void chp_id_init(struct chp_id *chpid)
1223
{
1324
memset(chpid, 0, sizeof(struct chp_id));

drivers/s390/cio/chp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ int chp_new(struct chp_id chpid)
509509
* On success return a newly allocated copy of the channel-path description
510510
* data associated with the given channel-path ID. Return %NULL on error.
511511
*/
512-
void *chp_get_chp_desc(struct chp_id chpid)
512+
struct channel_path_desc *chp_get_chp_desc(struct chp_id chpid)
513513
{
514514
struct channel_path *chp;
515515
struct channel_path_desc *desc;

drivers/s390/cio/chp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static inline struct channel_path *chpid_to_chp(struct chp_id chpid)
6060
int chp_get_status(struct chp_id chpid);
6161
u8 chp_get_sch_opm(struct subchannel *sch);
6262
int chp_is_registered(struct chp_id chpid);
63-
void *chp_get_chp_desc(struct chp_id chpid);
63+
struct channel_path_desc *chp_get_chp_desc(struct chp_id chpid);
6464
void chp_remove_cmg_attr(struct channel_path *chp);
6565
int chp_add_cmg_attr(struct channel_path *chp);
6666
int chp_update_desc(struct channel_path *chp);

drivers/s390/cio/chsc.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,6 @@ struct cmg_entry {
2121
u32 values[NR_MEASUREMENT_ENTRIES];
2222
} __attribute__ ((packed));
2323

24-
struct channel_path_desc {
25-
u8 flags;
26-
u8 lsn;
27-
u8 desc;
28-
u8 chpid;
29-
u8 swla;
30-
u8 zeroes;
31-
u8 chla;
32-
u8 chpp;
33-
} __attribute__ ((packed));
34-
3524
struct channel_path_desc_fmt1 {
3625
u8 flags;
3726
u8 lsn;

drivers/s390/cio/device_ops.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,14 +563,23 @@ int ccw_device_stlck(struct ccw_device *cdev)
563563
return rc;
564564
}
565565

566-
void *ccw_device_get_chp_desc(struct ccw_device *cdev, int chp_no)
566+
/**
567+
* chp_get_chp_desc - return newly allocated channel-path descriptor
568+
* @cdev: device to obtain the descriptor for
569+
* @chp_idx: index of the channel path
570+
*
571+
* On success return a newly allocated copy of the channel-path description
572+
* data associated with the given channel path. Return %NULL on error.
573+
*/
574+
struct channel_path_desc *ccw_device_get_chp_desc(struct ccw_device *cdev,
575+
int chp_idx)
567576
{
568577
struct subchannel *sch;
569578
struct chp_id chpid;
570579

571580
sch = to_subchannel(cdev->dev.parent);
572581
chp_id_init(&chpid);
573-
chpid.id = sch->schib.pmcw.chpid[chp_no];
582+
chpid.id = sch->schib.pmcw.chpid[chp_idx];
574583
return chp_get_chp_desc(chpid);
575584
}
576585

drivers/s390/net/qeth_core_main.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <net/iucv/af_iucv.h>
2323

2424
#include <asm/ebcdic.h>
25+
#include <asm/chpid.h>
2526
#include <asm/io.h>
2627
#include <asm/sysinfo.h>
2728
#include <asm/compat.h>
@@ -1344,16 +1345,7 @@ static void qeth_set_multiple_write_queues(struct qeth_card *card)
13441345
static void qeth_update_from_chp_desc(struct qeth_card *card)
13451346
{
13461347
struct ccw_device *ccwdev;
1347-
struct channelPath_dsc {
1348-
u8 flags;
1349-
u8 lsn;
1350-
u8 desc;
1351-
u8 chpid;
1352-
u8 swla;
1353-
u8 zeroes;
1354-
u8 chla;
1355-
u8 chpp;
1356-
} *chp_dsc;
1348+
struct channel_path_desc *chp_dsc;
13571349

13581350
QETH_DBF_TEXT(SETUP, 2, "chp_desc");
13591351

0 commit comments

Comments
 (0)