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 1/1] Staging: comedi: dmm32at: fix BIT macro issue.
Date: Fri, 10 Jun 2016 11:38:07 +0100 [thread overview]
Message-ID: <575A988F.9060408@mev.co.uk> (raw)
In-Reply-To: <1465473879-22017-1-git-send-email-ravishankarkm32@gmail.com>
On 09/06/16 13:04, Ravishankar Karkala Mallikarjunayya wrote:
> This Replace all occurences of (1<<x) by BIT(x) and DMM32AT_CTRL(x),
> DMM32AT_AI_CFG(x) macros 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 | 98 ++++++++++++++++----------------
> 1 file changed, 50 insertions(+), 48 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/dmm32at.c b/drivers/staging/comedi/drivers/dmm32at.c
> index 958c0d4..0d50105 100644
> --- a/drivers/staging/comedi/drivers/dmm32at.c
> +++ b/drivers/staging/comedi/drivers/dmm32at.c
[snip]
> -#define DMM32AT_CTRL_RESETA (1 << 5)
> -#define DMM32AT_CTRL_RESETD (1 << 4)
> -#define DMM32AT_CTRL_INTRST (1 << 3)
> -#define DMM32AT_CTRL_PAGE_8254 (0 << 0)
> -#define DMM32AT_CTRL_PAGE_8255 (1 << 0)
> -#define DMM32AT_CTRL_PAGE_CALIB (3 << 0)
> +#define DMM32AT_CTRL_RESETA BIT(5)
> +#define DMM32AT_CTRL_RESETD BIT(4)
> +#define DMM32AT_CTRL_INTRST BIT(3)
> +#define DMM32AT_CTRL(x) ((x) << 0)
> +#define DMM32AT_CTRL_PAGE_8254 DMM32AT_CTRL(0)
> +#define DMM32AT_CTRL_PAGE_8255 DMM32AT_CTRL(1)
> +#define DMM32AT_CTRL_PAGE_CALIB DMM32AT_CTRL(3)
The macro name DMM32AT_CTRL(x) is not specific enough. It should be
DMM32AT_CTRL_PAGE(x) to match the names of the macros that use it
(DMM32AT_CTRL_PAGE_8254 etc.).
[snip]
> -#define DMM32AT_AI_CFG_SCINT_20US (0 << 4)
> -#define DMM32AT_AI_CFG_SCINT_15US (1 << 4)
> -#define DMM32AT_AI_CFG_SCINT_10US (2 << 4)
> -#define DMM32AT_AI_CFG_SCINT_5US (3 << 4)
> -#define DMM32AT_AI_CFG_RANGE (1 << 3) /* 0=5V 1=10V */
> -#define DMM32AT_AI_CFG_ADBU (1 << 2) /* 0=bipolar 1=unipolar */
> +#define DMM32AT_AI_CFG(x) ((x) << 4)
> +#define DMM32AT_AI_CFG_SCINT_20US DMM32AT_AI_CFG(0)
> +#define DMM32AT_AI_CFG_SCINT_15US DMM32AT_AI_CFG(1)
> +#define DMM32AT_AI_CFG_SCINT_10US DMM32AT_AI_CFG(2)
> +#define DMM32AT_AI_CFG_SCINT_5US DMM32AT_AI_CFG(3)
The same thing here. Please rename DMM32AT_AI_CFG(x) to
DMM32AT_AI_CFG_SCINT(x).
(Don't forget to update the patch description to match these changes.)
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=-
-=( Web: http://www.mev.co.uk/ )=-
next prev parent reply other threads:[~2016-06-10 10:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-09 12:04 Ravishankar Karkala Mallikarjunayya
2016-06-10 10:38 ` Ian Abbott [this message]
2016-06-10 11:15 Ravishankar Karkala Mallikarjunayya
2016-06-10 11:33 ` Ian Abbott
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=575A988F.9060408@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome