Hi Bart, On Sun, Mar 01, 2020 at 07:30:23PM -0800, Bart Van Assche wrote: > Make the MMIO accessors stronly typed such that the compiler checks whether > the accessor function is used that matches the register width. Fix those > MMIO reads where another number of bits was read or written than the size > of the register. > > Cc: Himanshu Madhani <hmadhani@xxxxxxxxxxx> > Cc: Quinn Tran <qutran@xxxxxxxxxxx> > Cc: Martin Wilck <mwilck@xxxxxxxx> > Cc: Daniel Wagner <dwagner@xxxxxxx> > Cc: Roman Bolshakov <r.bolshakov@xxxxxxxxx> > Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx> > --- > drivers/scsi/qla2xxx/qla_def.h | 53 +++++++++++++++++++++++++++------ > drivers/scsi/qla2xxx/qla_init.c | 6 ++-- > drivers/scsi/qla2xxx/qla_iocb.c | 2 +- > drivers/scsi/qla2xxx/qla_isr.c | 4 +-- > drivers/scsi/qla2xxx/qla_mbx.c | 2 +- > drivers/scsi/qla2xxx/qla_mr.c | 26 ++++++++-------- > drivers/scsi/qla2xxx/qla_nx.c | 4 +-- > drivers/scsi/qla2xxx/qla_os.c | 2 +- > 8 files changed, 67 insertions(+), 32 deletions(-) > > diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h > index ebb22c1a9df7..7e5677c69bed 100644 > --- a/drivers/scsi/qla2xxx/qla_def.h > +++ b/drivers/scsi/qla2xxx/qla_def.h > @@ -128,15 +128,50 @@ static inline uint32_t make_handle(uint16_t x, uint16_t y) > * I/O register > */ > > -#define RD_REG_BYTE(addr) readb(addr) > -#define RD_REG_WORD(addr) readw(addr) > -#define RD_REG_DWORD(addr) readl(addr) > -#define RD_REG_BYTE_RELAXED(addr) readb_relaxed(addr) > -#define RD_REG_WORD_RELAXED(addr) readw_relaxed(addr) > -#define RD_REG_DWORD_RELAXED(addr) readl_relaxed(addr) > -#define WRT_REG_BYTE(addr, data) writeb(data, addr) > -#define WRT_REG_WORD(addr, data) writew(data, addr) > -#define WRT_REG_DWORD(addr, data) writel(data, addr) > +static inline u8 RD_REG_BYTE(const volatile u8 __iomem *addr) > +{ > + return readb(addr); > +} I would prefer lower case for the inline function names. Thanks, Daniel