All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: Ravishankar Karkala Mallikarjunayya <ravishankarkm32@gmail.com>,
	hsweeten@visionengravers.com, gregkh@linuxfoundation.org
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/5] Staging: comedi: dmm32at: Prefer using the BIT macro
Date: Wed, 8 Jun 2016 10:54:25 +0100	[thread overview]
Message-ID: <5757EB51.5040902@mev.co.uk> (raw)
In-Reply-To: <1465363832-9585-5-git-send-email-ravishankarkm32@gmail.com>

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/  )=-

      reply	other threads:[~2016-06-08  9:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-08  5:30 [PATCH 1/5] Staging: comedi: das16: fix blank line Ravishankar Karkala Mallikarjunayya
2016-06-08  5:30 ` [PATCH 2/5] Staging: comedi: das16: fix Block comment Ravishankar Karkala Mallikarjunayya
2016-06-08  9:47   ` Ian Abbott
2016-06-08  5:30 ` [PATCH 3/5] Staging: comedi: das800: fix comment issue Ravishankar Karkala Mallikarjunayya
2016-06-08  9:48   ` Ian Abbott
2016-06-08  5:30 ` [PATCH 4/5] Staging: comedi: das800: Prefer unsigned int instead of unsigned Ravishankar Karkala Mallikarjunayya
2016-06-08  9:49   ` Ian Abbott
2016-06-08  5:30 ` [PATCH 5/5] Staging: comedi: dmm32at: Prefer using the BIT macro Ravishankar Karkala Mallikarjunayya
2016-06-08  9:54   ` Ian Abbott [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5757EB51.5040902@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hsweeten@visionengravers.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ravishankarkm32@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.