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>
This commit is contained in:
parent
ddc1c94535
commit
0ee5f8dcd6
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue