diff options
author | Claudio Imbrenda <imbrenda@linux.vnet.ibm.com> | 2018-01-23 15:07:09 +0100 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2018-02-22 15:31:23 +0100 |
commit | 0ee5f8dcd69d3db8d4e63e79f2962d328c48531f (patch) | |
tree | 1ac44cce8b657d6b2f1255f658cb5ffb105a8fe5 /drivers | |
parent | ddc1c9453550eabd6284021b167f708982df3ca9 (diff) | |
download | linux-0ee5f8dcd69d3db8d4e63e79f2962d328c48531f.tar.gz linux-0ee5f8dcd69d3db8d4e63e79f2962d328c48531f.tar.bz2 linux-0ee5f8dcd69d3db8d4e63e79f2962d328c48531f.zip |
s390/sclp: clean up, use sccb_mask_t where appropriate
Replace hardcoded instances where 32 or unsigned int (or long) is used
for SCLP event masks, and replace with sizeof(sccb_mask_t) and
sccb_mask_t respectively.
This improves readability and prepares for when we will increase
sccb_mask_t to 64 bits.
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/char/sclp.c | 6 | ||||
-rw-r--r-- | drivers/s390/char/sclp.h | 6 | ||||
-rw-r--r-- | drivers/s390/char/sclp_early_core.c | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/drivers/s390/char/sclp.c b/drivers/s390/char/sclp.c index e4e2df7a478e..fe85f9aaf359 100644 --- a/drivers/s390/char/sclp.c +++ b/drivers/s390/char/sclp.c @@ -417,7 +417,7 @@ sclp_dispatch_evbufs(struct sccb_header *sccb) reg = NULL; list_for_each(l, &sclp_reg_list) { reg = list_entry(l, struct sclp_register, list); - if (reg->receive_mask & (1 << (32 - evbuf->type))) + if (reg->receive_mask & SCLP_EVTYP_MASK(evbuf->type)) break; else reg = NULL; @@ -748,7 +748,7 @@ EXPORT_SYMBOL(sclp_remove_processed); /* Prepare init mask request. Called while sclp_lock is locked. */ static inline void -__sclp_make_init_req(u32 receive_mask, u32 send_mask) +__sclp_make_init_req(sccb_mask_t receive_mask, sccb_mask_t send_mask) { struct init_sccb *sccb; @@ -761,7 +761,7 @@ __sclp_make_init_req(u32 receive_mask, u32 send_mask) sclp_init_req.callback = NULL; sclp_init_req.callback_data = NULL; sclp_init_req.sccb = sccb; - sccb->header.length = sizeof(struct init_sccb); + sccb->header.length = sizeof(*sccb); sccb->mask_length = sizeof(sccb_mask_t); sccb->receive_mask = receive_mask; sccb->send_mask = send_mask; diff --git a/drivers/s390/char/sclp.h b/drivers/s390/char/sclp.h index 9b10f12d3f53..e31aaf266154 100644 --- a/drivers/s390/char/sclp.h +++ b/drivers/s390/char/sclp.h @@ -18,7 +18,7 @@ #define MAX_KMEM_PAGES (sizeof(unsigned long) << 3) #define SCLP_CONSOLE_PAGES 6 -#define SCLP_EVTYP_MASK(T) (1U << (32 - (T))) +#define SCLP_EVTYP_MASK(T) (1UL << (sizeof(sccb_mask_t) * BITS_PER_BYTE - (T))) #define EVTYP_OPCMD 0x01 #define EVTYP_MSG 0x02 @@ -230,8 +230,8 @@ void sclp_early_wait_irq(void); int sclp_early_cmd(sclp_cmdw_t cmd, void *sccb); unsigned int sclp_early_con_check_linemode(struct init_sccb *sccb); int sclp_early_set_event_mask(struct init_sccb *sccb, - unsigned long receive_mask, - unsigned long send_mask); + sccb_mask_t receive_mask, + sccb_mask_t send_mask); /* useful inlines */ diff --git a/drivers/s390/char/sclp_early_core.c b/drivers/s390/char/sclp_early_core.c index 17b0c67f3e8d..e33d8be518d1 100644 --- a/drivers/s390/char/sclp_early_core.c +++ b/drivers/s390/char/sclp_early_core.c @@ -142,8 +142,8 @@ static void sclp_early_print_vt220(const char *str, unsigned int len) } int sclp_early_set_event_mask(struct init_sccb *sccb, - unsigned long receive_mask, - unsigned long send_mask) + sccb_mask_t receive_mask, + sccb_mask_t send_mask) { memset(sccb, 0, sizeof(*sccb)); sccb->header.length = sizeof(*sccb); |