lkml.org 
[lkml]   [2016]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 5/5] Staging: comedi: dmm32at: Prefer using the BIT macro
From
Date
On 08/06/16 06:30, Ravishankar Karkala Mallikarjunayya wrote:
> This fixes all occurences of (1<<x) by BIT(x) to get rid of checkpatch.pl
> "CHECK" output "Prefer using the BIT macro"
>
> Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com>
> ---
> drivers/staging/comedi/drivers/dmm32at.c | 86 ++++++++++++++++----------------
> 1 file changed, 43 insertions(+), 43 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/dmm32at.c b/drivers/staging/comedi/drivers/dmm32at.c
> index 958c0d4..4ca6104 100644
> --- a/drivers/staging/comedi/drivers/dmm32at.c
> +++ b/drivers/staging/comedi/drivers/dmm32at.c

Most of these are fine, but...

[snip]
> #define DMM32AT_CTRL_PAGE_8254 (0 << 0)
> -#define DMM32AT_CTRL_PAGE_8255 (1 << 0)
> +#define DMM32AT_CTRL_PAGE_8255 BIT(0)
> #define DMM32AT_CTRL_PAGE_CALIB (3 << 0)

That one makes the code less readable as the above three macros are for
the same bitfield, and should have similar-looking macro expansions.

[snip]
> #define DMM32AT_AI_CFG_SCINT_20US (0 << 4)
> -#define DMM32AT_AI_CFG_SCINT_15US (1 << 4)
> +#define DMM32AT_AI_CFG_SCINT_15US BIT(4)
> #define DMM32AT_AI_CFG_SCINT_10US (2 << 4)
> #define DMM32AT_AI_CFG_SCINT_5US (3 << 4)

The same thing here.

[snip]

--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=-
-=( Web: http://www.mev.co.uk/ )=-

\
 
 \ /
  Last update: 2016-06-08 12:21    [W:0.055 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site