From: H Hartley Sweeten Date: Mon, 11 Apr 2016 18:32:18 +0000 (-0700) Subject: staging: comedi: comedi_8254.h: tidy up the register map defines X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a104336d0eb929c589af841185c9aa7b5e03f81c;p=linux-beck.git staging: comedi: comedi_8254.h: tidy up the register map defines Tidy up the defines to fix the checkpatch.pl issues: CHECK: Prefer using the BIT macro Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/comedi_8254.h b/drivers/staging/comedi/drivers/comedi_8254.h index f4610ead6172..a12c29455d9d 100644 --- a/drivers/staging/comedi/drivers/comedi_8254.h +++ b/drivers/staging/comedi/drivers/comedi_8254.h @@ -53,13 +53,15 @@ struct comedi_subdevice; #define I8254_COUNTER2_REG 0x02 #define I8254_CTRL_REG 0x03 #define I8254_CTRL_SEL_CTR(x) ((x) << 6) -#define I8254_CTRL_READBACK_COUNT ((3 << 6) | (1 << 4)) -#define I8254_CTRL_READBACK_STATUS ((3 << 6) | (1 << 5)) +#define I8254_CTRL_READBACK(x) (I8254_CTRL_SEL_CTR(3) | BIT(x)) +#define I8254_CTRL_READBACK_COUNT I8254_CTRL_READBACK(4) +#define I8254_CTRL_READBACK_STATUS I8254_CTRL_READBACK(5) #define I8254_CTRL_READBACK_SEL_CTR(x) (2 << (x)) -#define I8254_CTRL_LATCH (0 << 4) -#define I8254_CTRL_LSB_ONLY (1 << 4) -#define I8254_CTRL_MSB_ONLY (2 << 4) -#define I8254_CTRL_LSB_MSB (3 << 4) +#define I8254_CTRL_RW(x) (((x) & 0x3) << 4) +#define I8254_CTRL_LATCH I8254_CTRL_RW(0) +#define I8254_CTRL_LSB_ONLY I8254_CTRL_RW(1) +#define I8254_CTRL_MSB_ONLY I8254_CTRL_RW(2) +#define I8254_CTRL_LSB_MSB I8254_CTRL_RW(3) /* counter maps zero to 0x10000 */ #define I8254_MAX_COUNT 0x10000