mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: Ranjith Thangavel <ranjithece24@gmail.com>, gregkh@linuxfoundation.org
Cc: hsweeten@visionengravers.com, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] comedi: pcmmio.c: Fix coding style - use BIT macro
Date: Thu, 12 Nov 2015 17:57:11 +0000	[thread overview]
Message-ID: <5644D2F7.7080403@mev.co.uk> (raw)
In-Reply-To: <1447256920-11679-1-git-send-email-ranjithece24@gmail.com>

On 11/11/15 15:48, Ranjith Thangavel wrote:
> BIT macro is used for defining BIT location instead of
> shifting operator - coding style issue
>
> Signed-off-by: Ranjith Thangavel <ranjithece24@gmail.com>
> ---
>   drivers/staging/comedi/drivers/pcmmio.c |   44 +++++++++++++++----------------
>   1 file changed, 22 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/pcmmio.c b/drivers/staging/comedi/drivers/pcmmio.c
> index 10472e6..f7ec224 100644
> --- a/drivers/staging/comedi/drivers/pcmmio.c
> +++ b/drivers/staging/comedi/drivers/pcmmio.c
> @@ -84,25 +84,25 @@
>   #define PCMMIO_AI_LSB_REG			0x00
>   #define PCMMIO_AI_MSB_REG			0x01
>   #define PCMMIO_AI_CMD_REG			0x02
> -#define PCMMIO_AI_CMD_SE			(1 << 7)
> -#define PCMMIO_AI_CMD_ODD_CHAN			(1 << 6)
> +#define PCMMIO_AI_CMD_SE				BIT(7)
> +#define PCMMIO_AI_CMD_ODD_CHAN			BIT(6)
>   #define PCMMIO_AI_CMD_CHAN_SEL(x)		(((x) & 0x3) << 4)
>   #define PCMMIO_AI_CMD_RANGE(x)			(((x) & 0x3) << 2)
> -#define PCMMIO_RESOURCE_REG			0x02
> +#define PCMMIO_RESOURCE_REG				0x02
>   #define PCMMIO_RESOURCE_IRQ(x)			(((x) & 0xf) << 0)
>   #define PCMMIO_AI_STATUS_REG			0x03
> -#define PCMMIO_AI_STATUS_DATA_READY		(1 << 7)
> -#define PCMMIO_AI_STATUS_DATA_DMA_PEND		(1 << 6)
> -#define PCMMIO_AI_STATUS_CMD_DMA_PEND		(1 << 5)
> -#define PCMMIO_AI_STATUS_IRQ_PEND		(1 << 4)
> -#define PCMMIO_AI_STATUS_DATA_DRQ_ENA		(1 << 2)
> -#define PCMMIO_AI_STATUS_REG_SEL		(1 << 3)
> -#define PCMMIO_AI_STATUS_CMD_DRQ_ENA		(1 << 1)
> -#define PCMMIO_AI_STATUS_IRQ_ENA		(1 << 0)
> +#define PCMMIO_AI_STATUS_DATA_READY		BIT(7)
> +#define PCMMIO_AI_STATUS_DATA_DMA_PEND	BIT(6)
> +#define PCMMIO_AI_STATUS_CMD_DMA_PEND	BIT(5)
> +#define PCMMIO_AI_STATUS_IRQ_PEND		BIT(4)
> +#define PCMMIO_AI_STATUS_DATA_DRQ_ENA	BIT(2)
> +#define PCMMIO_AI_STATUS_REG_SEL		BIT(3)
> +#define PCMMIO_AI_STATUS_CMD_DRQ_ENA	BIT(1)
> +#define PCMMIO_AI_STATUS_IRQ_ENA		BIT(0)
>   #define PCMMIO_AI_RES_ENA_REG			0x03
> -#define PCMMIO_AI_RES_ENA_CMD_REG_ACCESS	(0 << 3)
> -#define PCMMIO_AI_RES_ENA_AI_RES_ACCESS		(1 << 3)
> -#define PCMMIO_AI_RES_ENA_DIO_RES_ACCESS	(1 << 4)
> +#define PCMMIO_AI_RES_ENA_CMD_REG_ACCESS	0
> +#define PCMMIO_AI_RES_ENA_AI_RES_ACCESS		BIT(3)
> +#define PCMMIO_AI_RES_ENA_DIO_RES_ACCESS	BIT(4)
>   #define PCMMIO_AI_2ND_ADC_OFFSET		0x04
>
>   #define PCMMIO_AO_LSB_REG			0x08
> @@ -125,14 +125,14 @@
>   #define PCMMIO_AO_CMD_CHAN_SEL(x)		(((x) & 0x03) << 1)
>   #define PCMMIO_AO_CMD_CHAN_SEL_ALL		(0x0f << 0)
>   #define PCMMIO_AO_STATUS_REG			0x0b
> -#define PCMMIO_AO_STATUS_DATA_READY		(1 << 7)
> -#define PCMMIO_AO_STATUS_DATA_DMA_PEND		(1 << 6)
> -#define PCMMIO_AO_STATUS_CMD_DMA_PEND		(1 << 5)
> -#define PCMMIO_AO_STATUS_IRQ_PEND		(1 << 4)
> -#define PCMMIO_AO_STATUS_DATA_DRQ_ENA		(1 << 2)
> -#define PCMMIO_AO_STATUS_REG_SEL		(1 << 3)
> -#define PCMMIO_AO_STATUS_CMD_DRQ_ENA		(1 << 1)
> -#define PCMMIO_AO_STATUS_IRQ_ENA		(1 << 0)
> +#define PCMMIO_AO_STATUS_DATA_READY		BIT(7)
> +#define PCMMIO_AO_STATUS_DATA_DMA_PEND	BIT(6)
> +#define PCMMIO_AO_STATUS_CMD_DMA_PEND	BIT(5)
> +#define PCMMIO_AO_STATUS_IRQ_PEND		BIT(4)
> +#define PCMMIO_AO_STATUS_DATA_DRQ_ENA	BIT(2)
> +#define PCMMIO_AO_STATUS_REG_SEL		BIT(3)
> +#define PCMMIO_AO_STATUS_CMD_DRQ_ENA	BIT(1)
> +#define PCMMIO_AO_STATUS_IRQ_ENA		BIT(0)
>   #define PCMMIO_AO_RESOURCE_ENA_REG		0x0b
>   #define PCMMIO_AO_2ND_DAC_OFFSET		0x04
>
>

The macro values used to be more-or-less nicely aligned in a column, but 
now they are not so nicely aligned.  Could you add or delete TABs as 
needed to line them up?  Remember, tab stops are every 8 spaces.

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

      reply	other threads:[~2015-11-12 17:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-11 15:48 Ranjith Thangavel
2015-11-12 17:57 ` 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=5644D2F7.7080403@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=ranjithece24@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