diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index 6e2fd445688c..785aba11066b 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c @@ -199,8 +199,8 @@ recs_per_track(struct dasd_eckd_characteristics * rdc, static void set_ch_t(struct ch_t *geo, __u32 cyl, __u8 head) { geo->cyl = (__u16) cyl; - geo->head = cyl >> 16; - geo->head <<= 4; + geo->head = cyl >> DASD_EAV_CYL_HI_SHIFT; + geo->head <<= DASD_EAV_HEAD_HI_SHIFT; geo->head |= head; } diff --git a/drivers/s390/block/dasd_eckd.h b/drivers/s390/block/dasd_eckd.h index 763733bcc4d2..bad7ba666370 100644 --- a/drivers/s390/block/dasd_eckd.h +++ b/drivers/s390/block/dasd_eckd.h @@ -146,6 +146,14 @@ struct eckd_count { __u16 dl; } __attribute__ ((packed)); +/* + * Extended Address Volume track address: the head field carries the actual + * head in its low-order 4 bits; the cylinder bits that do not fit the 16-bit + * cyl field are shifted in just above them. + */ +#define DASD_EAV_CYL_HI_SHIFT 16 /* cylinder bits beyond the 16-bit cyl field */ +#define DASD_EAV_HEAD_HI_SHIFT 4 /* head occupies the low-order 4 bits of head */ + struct ch_t { __u16 cyl; __u16 head;