All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] comedi: ni_6527: Fix coding style - use BIT macro
@ 2015-11-14 13:13 Ranjith Thangavel
  2015-11-16 14:33 ` Dan Carpenter
  2015-11-18 16:02 ` Ian Abbott
  0 siblings, 2 replies; 8+ messages in thread
From: Ranjith Thangavel @ 2015-11-14 13:13 UTC (permalink / raw)
  To: gregkh; +Cc: abbotti, hsweeten, devel, linux-kernel, ranjithece24

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/ni_6527.c |   27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_6527.c b/drivers/staging/comedi/drivers/ni_6527.c
index b340b98..1903d64 100644
--- a/drivers/staging/comedi/drivers/ni_6527.c
+++ b/drivers/staging/comedi/drivers/ni_6527.c
@@ -32,6 +32,8 @@
 
 #include "../comedi_pci.h"
 
+#include "comedi_fc.h"
+
 /*
  * PCI BAR1 - Register memory map
  *
@@ -52,13 +54,13 @@
 #define NI6527_FILT_ENA_REG(x)		(0x0c + (x))
 #define NI6527_STATUS_REG		0x14
 #define NI6527_STATUS_IRQ		BIT(2)
-#define NI6527_STATUS_OVERFLOW	BIT(1)
+#define NI6527_STATUS_OVERFLOW		BIT(1)
 #define NI6527_STATUS_EDGE		BIT(0)
 #define NI6527_CTRL_REG			0x15
 #define NI6527_CTRL_FALLING		BIT(4)
 #define NI6527_CTRL_RISING		BIT(3)
 #define NI6527_CTRL_IRQ			BIT(2)
-#define NI6527_CTRL_OVERFLOW	BIT(1)
+#define NI6527_CTRL_OVERFLOW		BIT(1)
 #define NI6527_CTRL_EDGE		BIT(0)
 #define NI6527_CTRL_DISABLE_IRQS	0
 #define NI6527_CTRL_ENABLE_IRQS		(NI6527_CTRL_FALLING | \
@@ -221,11 +223,11 @@ static int ni6527_intr_cmdtest(struct comedi_device *dev,
 
 	/* Step 1 : check if triggers are trivially valid */
 
-	err |= comedi_check_trigger_src(&cmd->start_src, TRIG_NOW);
-	err |= comedi_check_trigger_src(&cmd->scan_begin_src, TRIG_OTHER);
-	err |= comedi_check_trigger_src(&cmd->convert_src, TRIG_FOLLOW);
-	err |= comedi_check_trigger_src(&cmd->scan_end_src, TRIG_COUNT);
-	err |= comedi_check_trigger_src(&cmd->stop_src, TRIG_COUNT);
+	err |= cfc_check_trigger_src(&cmd->start_src, TRIG_NOW);
+	err |= cfc_check_trigger_src(&cmd->scan_begin_src, TRIG_OTHER);
+	err |= cfc_check_trigger_src(&cmd->convert_src, TRIG_FOLLOW);
+	err |= cfc_check_trigger_src(&cmd->scan_end_src, TRIG_COUNT);
+	err |= cfc_check_trigger_src(&cmd->stop_src, TRIG_COUNT);
 
 	if (err)
 		return 1;
@@ -235,12 +237,11 @@ static int ni6527_intr_cmdtest(struct comedi_device *dev,
 
 	/* Step 3: check if arguments are trivially valid */
 
-	err |= comedi_check_trigger_arg_is(&cmd->start_arg, 0);
-	err |= comedi_check_trigger_arg_is(&cmd->scan_begin_arg, 0);
-	err |= comedi_check_trigger_arg_is(&cmd->convert_arg, 0);
-	err |= comedi_check_trigger_arg_is(&cmd->scan_end_arg,
-					   cmd->chanlist_len);
-	err |= comedi_check_trigger_arg_is(&cmd->stop_arg, 0);
+	err |= cfc_check_trigger_arg_is(&cmd->start_arg, 0);
+	err |= cfc_check_trigger_arg_is(&cmd->scan_begin_arg, 0);
+	err |= cfc_check_trigger_arg_is(&cmd->convert_arg, 0);
+	err |= cfc_check_trigger_arg_is(&cmd->scan_end_arg, cmd->chanlist_len);
+	err |= cfc_check_trigger_arg_is(&cmd->stop_arg, 0);
 
 	if (err)
 		return 3;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] comedi: ni_6527: Fix coding style - use BIT macro
  2015-11-14 13:13 [PATCH] comedi: ni_6527: Fix coding style - use BIT macro Ranjith Thangavel
@ 2015-11-16 14:33 ` Dan Carpenter
  2015-11-18 16:02 ` Ian Abbott
  1 sibling, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2015-11-16 14:33 UTC (permalink / raw)
  To: Ranjith Thangavel; +Cc: gregkh, devel, abbotti, linux-kernel

On Sat, Nov 14, 2015 at 06:43:23PM +0530, Ranjith Thangavel wrote:
> @@ -221,11 +223,11 @@ static int ni6527_intr_cmdtest(struct comedi_device *dev,
>  
>  	/* Step 1 : check if triggers are trivially valid */
>  
> -	err |= comedi_check_trigger_src(&cmd->start_src, TRIG_NOW);
> -	err |= comedi_check_trigger_src(&cmd->scan_begin_src, TRIG_OTHER);
> -	err |= comedi_check_trigger_src(&cmd->convert_src, TRIG_FOLLOW);
> -	err |= comedi_check_trigger_src(&cmd->scan_end_src, TRIG_COUNT);
> -	err |= comedi_check_trigger_src(&cmd->stop_src, TRIG_COUNT);
> +	err |= cfc_check_trigger_src(&cmd->start_src, TRIG_NOW);
> +	err |= cfc_check_trigger_src(&cmd->scan_begin_src, TRIG_OTHER);
> +	err |= cfc_check_trigger_src(&cmd->convert_src, TRIG_FOLLOW);
> +	err |= cfc_check_trigger_src(&cmd->scan_end_src, TRIG_COUNT);
> +	err |= cfc_check_trigger_src(&cmd->stop_src, TRIG_COUNT);
>  
>  	if (err)
>  		return 1;

This part looks to be included by mistake.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] comedi: ni_6527: Fix coding style - use BIT macro
  2015-11-14 13:13 [PATCH] comedi: ni_6527: Fix coding style - use BIT macro Ranjith Thangavel
  2015-11-16 14:33 ` Dan Carpenter
@ 2015-11-18 16:02 ` Ian Abbott
  1 sibling, 0 replies; 8+ messages in thread
From: Ian Abbott @ 2015-11-18 16:02 UTC (permalink / raw)
  To: Ranjith Thangavel, gregkh; +Cc: hsweeten, devel, linux-kernel

On 14/11/15 13:13, 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/ni_6527.c |   27 ++++++++++++++-------------
>   1 file changed, 14 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/ni_6527.c b/drivers/staging/comedi/drivers/ni_6527.c
> index b340b98..1903d64 100644
> --- a/drivers/staging/comedi/drivers/ni_6527.c
> +++ b/drivers/staging/comedi/drivers/ni_6527.c
> @@ -32,6 +32,8 @@
>
>   #include "../comedi_pci.h"
>
> +#include "comedi_fc.h"
> +

That part seems to have been added in by mistake.

>   /*
>    * PCI BAR1 - Register memory map
>    *
> @@ -52,13 +54,13 @@
>   #define NI6527_FILT_ENA_REG(x)		(0x0c + (x))
>   #define NI6527_STATUS_REG		0x14
>   #define NI6527_STATUS_IRQ		BIT(2)
> -#define NI6527_STATUS_OVERFLOW	BIT(1)
> +#define NI6527_STATUS_OVERFLOW		BIT(1)
>   #define NI6527_STATUS_EDGE		BIT(0)
>   #define NI6527_CTRL_REG			0x15
>   #define NI6527_CTRL_FALLING		BIT(4)
>   #define NI6527_CTRL_RISING		BIT(3)
>   #define NI6527_CTRL_IRQ			BIT(2)
> -#define NI6527_CTRL_OVERFLOW	BIT(1)
> +#define NI6527_CTRL_OVERFLOW		BIT(1)
>   #define NI6527_CTRL_EDGE		BIT(0)
>   #define NI6527_CTRL_DISABLE_IRQS	0
>   #define NI6527_CTRL_ENABLE_IRQS		(NI6527_CTRL_FALLING | \

That part seems to be based on top of your previous patch that had 
whitespace issues.

> @@ -221,11 +223,11 @@ static int ni6527_intr_cmdtest(struct comedi_device *dev,
>
>   	/* Step 1 : check if triggers are trivially valid */
>
> -	err |= comedi_check_trigger_src(&cmd->start_src, TRIG_NOW);
> -	err |= comedi_check_trigger_src(&cmd->scan_begin_src, TRIG_OTHER);
> -	err |= comedi_check_trigger_src(&cmd->convert_src, TRIG_FOLLOW);
> -	err |= comedi_check_trigger_src(&cmd->scan_end_src, TRIG_COUNT);
> -	err |= comedi_check_trigger_src(&cmd->stop_src, TRIG_COUNT);
> +	err |= cfc_check_trigger_src(&cmd->start_src, TRIG_NOW);
> +	err |= cfc_check_trigger_src(&cmd->scan_begin_src, TRIG_OTHER);
> +	err |= cfc_check_trigger_src(&cmd->convert_src, TRIG_FOLLOW);
> +	err |= cfc_check_trigger_src(&cmd->scan_end_src, TRIG_COUNT);
> +	err |= cfc_check_trigger_src(&cmd->stop_src, TRIG_COUNT);
>
>   	if (err)
>   		return 1;
> @@ -235,12 +237,11 @@ static int ni6527_intr_cmdtest(struct comedi_device *dev,
>
>   	/* Step 3: check if arguments are trivially valid */
>
> -	err |= comedi_check_trigger_arg_is(&cmd->start_arg, 0);
> -	err |= comedi_check_trigger_arg_is(&cmd->scan_begin_arg, 0);
> -	err |= comedi_check_trigger_arg_is(&cmd->convert_arg, 0);
> -	err |= comedi_check_trigger_arg_is(&cmd->scan_end_arg,
> -					   cmd->chanlist_len);
> -	err |= comedi_check_trigger_arg_is(&cmd->stop_arg, 0);
> +	err |= cfc_check_trigger_arg_is(&cmd->start_arg, 0);
> +	err |= cfc_check_trigger_arg_is(&cmd->scan_begin_arg, 0);
> +	err |= cfc_check_trigger_arg_is(&cmd->convert_arg, 0);
> +	err |= cfc_check_trigger_arg_is(&cmd->scan_end_arg, cmd->chanlist_len);
> +	err |= cfc_check_trigger_arg_is(&cmd->stop_arg, 0);
>
>   	if (err)
>   		return 3;
>

As Dan Carpenter pointed out, this part has been added by mistake.

The parts added by mistake seem to be a throwback to an earlier kernel 
version.

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] comedi: ni_6527: Fix coding style - use BIT macro
  2015-11-16 16:56 Ranjith Thangavel
@ 2015-11-18 16:36 ` Ian Abbott
  0 siblings, 0 replies; 8+ messages in thread
From: Ian Abbott @ 2015-11-18 16:36 UTC (permalink / raw)
  To: Ranjith Thangavel, gregkh; +Cc: hsweeten, devel, linux-kernel

On 16/11/15 16:56, 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/ni_6527.c |   24 ++++++++++++------------
>   1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/ni_6527.c b/drivers/staging/comedi/drivers/ni_6527.c
> index 62a817e..84c62e2 100644
> --- a/drivers/staging/comedi/drivers/ni_6527.c
> +++ b/drivers/staging/comedi/drivers/ni_6527.c
> @@ -42,24 +42,24 @@
>   #define NI6527_DO_REG(x)		(0x03 + (x))
>   #define NI6527_ID_REG			0x06
>   #define NI6527_CLR_REG			0x07
> -#define NI6527_CLR_EDGE			(1 << 3)
> -#define NI6527_CLR_OVERFLOW		(1 << 2)
> -#define NI6527_CLR_FILT			(1 << 1)
> -#define NI6527_CLR_INTERVAL		(1 << 0)
> +#define NI6527_CLR_EDGE			BIT(3)
> +#define NI6527_CLR_OVERFLOW		BIT(2)
> +#define NI6527_CLR_FILT			BIT(1)
> +#define NI6527_CLR_INTERVAL		BIT(0)
>   #define NI6527_CLR_IRQS			(NI6527_CLR_EDGE | NI6527_CLR_OVERFLOW)
>   #define NI6527_CLR_RESET_FILT		(NI6527_CLR_FILT | NI6527_CLR_INTERVAL)
>   #define NI6527_FILT_INTERVAL_REG(x)	(0x08 + (x))
>   #define NI6527_FILT_ENA_REG(x)		(0x0c + (x))
>   #define NI6527_STATUS_REG		0x14
> -#define NI6527_STATUS_IRQ		(1 << 2)
> -#define NI6527_STATUS_OVERFLOW		(1 << 1)
> -#define NI6527_STATUS_EDGE		(1 << 0)
> +#define NI6527_STATUS_IRQ		BIT(2)
> +#define NI6527_STATUS_OVERFLOW		BIT(1)
> +#define NI6527_STATUS_EDGE		BIT(0)
>   #define NI6527_CTRL_REG			0x15
> -#define NI6527_CTRL_FALLING		(1 << 4)
> -#define NI6527_CTRL_RISING		(1 << 3)
> -#define NI6527_CTRL_IRQ			(1 << 2)
> -#define NI6527_CTRL_OVERFLOW		(1 << 1)
> -#define NI6527_CTRL_EDGE		(1 << 0)
> +#define NI6527_CTRL_FALLING		BIT(4)
> +#define NI6527_CTRL_RISING		BIT(3)
> +#define NI6527_CTRL_IRQ			BIT(2)
> +#define NI6527_CTRL_OVERFLOW		BIT(1)
> +#define NI6527_CTRL_EDGE		BIT(0)
>   #define NI6527_CTRL_DISABLE_IRQS	0
>   #define NI6527_CTRL_ENABLE_IRQS		(NI6527_CTRL_FALLING | \
>   					 NI6527_CTRL_RISING | \
>

Thanks!

Reviewed-by: Ian Abbott <abbotti@mev.co.uk>

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] comedi: ni_6527: Fix coding style - use BIT macro
@ 2015-11-16 16:56 Ranjith Thangavel
  2015-11-18 16:36 ` Ian Abbott
  0 siblings, 1 reply; 8+ messages in thread
From: Ranjith Thangavel @ 2015-11-16 16:56 UTC (permalink / raw)
  To: gregkh; +Cc: abbotti, hsweeten, devel, linux-kernel, ranjithece24

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/ni_6527.c |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_6527.c b/drivers/staging/comedi/drivers/ni_6527.c
index 62a817e..84c62e2 100644
--- a/drivers/staging/comedi/drivers/ni_6527.c
+++ b/drivers/staging/comedi/drivers/ni_6527.c
@@ -42,24 +42,24 @@
 #define NI6527_DO_REG(x)		(0x03 + (x))
 #define NI6527_ID_REG			0x06
 #define NI6527_CLR_REG			0x07
-#define NI6527_CLR_EDGE			(1 << 3)
-#define NI6527_CLR_OVERFLOW		(1 << 2)
-#define NI6527_CLR_FILT			(1 << 1)
-#define NI6527_CLR_INTERVAL		(1 << 0)
+#define NI6527_CLR_EDGE			BIT(3)
+#define NI6527_CLR_OVERFLOW		BIT(2)
+#define NI6527_CLR_FILT			BIT(1)
+#define NI6527_CLR_INTERVAL		BIT(0)
 #define NI6527_CLR_IRQS			(NI6527_CLR_EDGE | NI6527_CLR_OVERFLOW)
 #define NI6527_CLR_RESET_FILT		(NI6527_CLR_FILT | NI6527_CLR_INTERVAL)
 #define NI6527_FILT_INTERVAL_REG(x)	(0x08 + (x))
 #define NI6527_FILT_ENA_REG(x)		(0x0c + (x))
 #define NI6527_STATUS_REG		0x14
-#define NI6527_STATUS_IRQ		(1 << 2)
-#define NI6527_STATUS_OVERFLOW		(1 << 1)
-#define NI6527_STATUS_EDGE		(1 << 0)
+#define NI6527_STATUS_IRQ		BIT(2)
+#define NI6527_STATUS_OVERFLOW		BIT(1)
+#define NI6527_STATUS_EDGE		BIT(0)
 #define NI6527_CTRL_REG			0x15
-#define NI6527_CTRL_FALLING		(1 << 4)
-#define NI6527_CTRL_RISING		(1 << 3)
-#define NI6527_CTRL_IRQ			(1 << 2)
-#define NI6527_CTRL_OVERFLOW		(1 << 1)
-#define NI6527_CTRL_EDGE		(1 << 0)
+#define NI6527_CTRL_FALLING		BIT(4)
+#define NI6527_CTRL_RISING		BIT(3)
+#define NI6527_CTRL_IRQ			BIT(2)
+#define NI6527_CTRL_OVERFLOW		BIT(1)
+#define NI6527_CTRL_EDGE		BIT(0)
 #define NI6527_CTRL_DISABLE_IRQS	0
 #define NI6527_CTRL_ENABLE_IRQS		(NI6527_CTRL_FALLING | \
 					 NI6527_CTRL_RISING | \
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] comedi: ni_6527: Fix coding style - use BIT macro
  2015-11-11 16:14 Ranjith Thangavel
@ 2015-11-12 17:59 ` Ian Abbott
  0 siblings, 0 replies; 8+ messages in thread
From: Ian Abbott @ 2015-11-12 17:59 UTC (permalink / raw)
  To: Ranjith Thangavel, gregkh; +Cc: hsweeten, devel, linux-kernel

On 11/11/15 16:14, 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/ni_6527.c |   24 ++++++++++++------------
>   1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/ni_6527.c b/drivers/staging/comedi/drivers/ni_6527.c
> index 62a817e..b340b98 100644
> --- a/drivers/staging/comedi/drivers/ni_6527.c
> +++ b/drivers/staging/comedi/drivers/ni_6527.c
> @@ -42,24 +42,24 @@
>   #define NI6527_DO_REG(x)		(0x03 + (x))
>   #define NI6527_ID_REG			0x06
>   #define NI6527_CLR_REG			0x07
> -#define NI6527_CLR_EDGE			(1 << 3)
> -#define NI6527_CLR_OVERFLOW		(1 << 2)
> -#define NI6527_CLR_FILT			(1 << 1)
> -#define NI6527_CLR_INTERVAL		(1 << 0)
> +#define NI6527_CLR_EDGE			BIT(3)
> +#define NI6527_CLR_OVERFLOW		BIT(2)
> +#define NI6527_CLR_FILT			BIT(1)
> +#define NI6527_CLR_INTERVAL		BIT(0)
>   #define NI6527_CLR_IRQS			(NI6527_CLR_EDGE | NI6527_CLR_OVERFLOW)
>   #define NI6527_CLR_RESET_FILT		(NI6527_CLR_FILT | NI6527_CLR_INTERVAL)
>   #define NI6527_FILT_INTERVAL_REG(x)	(0x08 + (x))
>   #define NI6527_FILT_ENA_REG(x)		(0x0c + (x))
>   #define NI6527_STATUS_REG		0x14
> -#define NI6527_STATUS_IRQ		(1 << 2)
> -#define NI6527_STATUS_OVERFLOW		(1 << 1)
> -#define NI6527_STATUS_EDGE		(1 << 0)
> +#define NI6527_STATUS_IRQ		BIT(2)
> +#define NI6527_STATUS_OVERFLOW	BIT(1)
> +#define NI6527_STATUS_EDGE		BIT(0)
>   #define NI6527_CTRL_REG			0x15
> -#define NI6527_CTRL_FALLING		(1 << 4)
> -#define NI6527_CTRL_RISING		(1 << 3)
> -#define NI6527_CTRL_IRQ			(1 << 2)
> -#define NI6527_CTRL_OVERFLOW		(1 << 1)
> -#define NI6527_CTRL_EDGE		(1 << 0)
> +#define NI6527_CTRL_FALLING		BIT(4)
> +#define NI6527_CTRL_RISING		BIT(3)
> +#define NI6527_CTRL_IRQ			BIT(2)
> +#define NI6527_CTRL_OVERFLOW	BIT(1)
> +#define NI6527_CTRL_EDGE		BIT(0)
>   #define NI6527_CTRL_DISABLE_IRQS	0
>   #define NI6527_CTRL_ENABLE_IRQS		(NI6527_CTRL_FALLING | \
>   					 NI6527_CTRL_RISING | \
>

Again, the column with the macro values is a bit misaligned.  Could you 
fix it please?

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] comedi: ni_6527: Fix coding style - use BIT macro
@ 2015-11-11 16:14 Ranjith Thangavel
  2015-11-12 17:59 ` Ian Abbott
  0 siblings, 1 reply; 8+ messages in thread
From: Ranjith Thangavel @ 2015-11-11 16:14 UTC (permalink / raw)
  To: gregkh; +Cc: abbotti, hsweeten, devel, linux-kernel, ranjithece24

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/ni_6527.c |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_6527.c b/drivers/staging/comedi/drivers/ni_6527.c
index 62a817e..b340b98 100644
--- a/drivers/staging/comedi/drivers/ni_6527.c
+++ b/drivers/staging/comedi/drivers/ni_6527.c
@@ -42,24 +42,24 @@
 #define NI6527_DO_REG(x)		(0x03 + (x))
 #define NI6527_ID_REG			0x06
 #define NI6527_CLR_REG			0x07
-#define NI6527_CLR_EDGE			(1 << 3)
-#define NI6527_CLR_OVERFLOW		(1 << 2)
-#define NI6527_CLR_FILT			(1 << 1)
-#define NI6527_CLR_INTERVAL		(1 << 0)
+#define NI6527_CLR_EDGE			BIT(3)
+#define NI6527_CLR_OVERFLOW		BIT(2)
+#define NI6527_CLR_FILT			BIT(1)
+#define NI6527_CLR_INTERVAL		BIT(0)
 #define NI6527_CLR_IRQS			(NI6527_CLR_EDGE | NI6527_CLR_OVERFLOW)
 #define NI6527_CLR_RESET_FILT		(NI6527_CLR_FILT | NI6527_CLR_INTERVAL)
 #define NI6527_FILT_INTERVAL_REG(x)	(0x08 + (x))
 #define NI6527_FILT_ENA_REG(x)		(0x0c + (x))
 #define NI6527_STATUS_REG		0x14
-#define NI6527_STATUS_IRQ		(1 << 2)
-#define NI6527_STATUS_OVERFLOW		(1 << 1)
-#define NI6527_STATUS_EDGE		(1 << 0)
+#define NI6527_STATUS_IRQ		BIT(2)
+#define NI6527_STATUS_OVERFLOW	BIT(1)
+#define NI6527_STATUS_EDGE		BIT(0)
 #define NI6527_CTRL_REG			0x15
-#define NI6527_CTRL_FALLING		(1 << 4)
-#define NI6527_CTRL_RISING		(1 << 3)
-#define NI6527_CTRL_IRQ			(1 << 2)
-#define NI6527_CTRL_OVERFLOW		(1 << 1)
-#define NI6527_CTRL_EDGE		(1 << 0)
+#define NI6527_CTRL_FALLING		BIT(4)
+#define NI6527_CTRL_RISING		BIT(3)
+#define NI6527_CTRL_IRQ			BIT(2)
+#define NI6527_CTRL_OVERFLOW	BIT(1)
+#define NI6527_CTRL_EDGE		BIT(0)
 #define NI6527_CTRL_DISABLE_IRQS	0
 #define NI6527_CTRL_ENABLE_IRQS		(NI6527_CTRL_FALLING | \
 					 NI6527_CTRL_RISING | \
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] comedi: ni_6527: Fix coding style - use BIT macro
@ 2015-11-09 17:57 Ranjith T
  0 siblings, 0 replies; 8+ messages in thread
From: Ranjith T @ 2015-11-09 17:57 UTC (permalink / raw)
  To: gregkh; +Cc: abbotti, hsweeten, devel, linux-kernel, ranjithece24

BIT macro is used for defining BIT location instead of
shifting operator - coding style issue

Signed-off-by: Ranjith T <ranjithece24@gmail.com>
---
 drivers/staging/comedi/drivers/ni_6527.c |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_6527.c b/drivers/staging/comedi/drivers/ni_6527.c
index 62a817e..b340b98 100644
--- a/drivers/staging/comedi/drivers/ni_6527.c
+++ b/drivers/staging/comedi/drivers/ni_6527.c
@@ -42,24 +42,24 @@
 #define NI6527_DO_REG(x)		(0x03 + (x))
 #define NI6527_ID_REG			0x06
 #define NI6527_CLR_REG			0x07
-#define NI6527_CLR_EDGE			(1 << 3)
-#define NI6527_CLR_OVERFLOW		(1 << 2)
-#define NI6527_CLR_FILT			(1 << 1)
-#define NI6527_CLR_INTERVAL		(1 << 0)
+#define NI6527_CLR_EDGE			BIT(3)
+#define NI6527_CLR_OVERFLOW		BIT(2)
+#define NI6527_CLR_FILT			BIT(1)
+#define NI6527_CLR_INTERVAL		BIT(0)
 #define NI6527_CLR_IRQS			(NI6527_CLR_EDGE | NI6527_CLR_OVERFLOW)
 #define NI6527_CLR_RESET_FILT		(NI6527_CLR_FILT | NI6527_CLR_INTERVAL)
 #define NI6527_FILT_INTERVAL_REG(x)	(0x08 + (x))
 #define NI6527_FILT_ENA_REG(x)		(0x0c + (x))
 #define NI6527_STATUS_REG		0x14
-#define NI6527_STATUS_IRQ		(1 << 2)
-#define NI6527_STATUS_OVERFLOW		(1 << 1)
-#define NI6527_STATUS_EDGE		(1 << 0)
+#define NI6527_STATUS_IRQ		BIT(2)
+#define NI6527_STATUS_OVERFLOW	BIT(1)
+#define NI6527_STATUS_EDGE		BIT(0)
 #define NI6527_CTRL_REG			0x15
-#define NI6527_CTRL_FALLING		(1 << 4)
-#define NI6527_CTRL_RISING		(1 << 3)
-#define NI6527_CTRL_IRQ			(1 << 2)
-#define NI6527_CTRL_OVERFLOW		(1 << 1)
-#define NI6527_CTRL_EDGE		(1 << 0)
+#define NI6527_CTRL_FALLING		BIT(4)
+#define NI6527_CTRL_RISING		BIT(3)
+#define NI6527_CTRL_IRQ			BIT(2)
+#define NI6527_CTRL_OVERFLOW	BIT(1)
+#define NI6527_CTRL_EDGE		BIT(0)
 #define NI6527_CTRL_DISABLE_IRQS	0
 #define NI6527_CTRL_ENABLE_IRQS		(NI6527_CTRL_FALLING | \
 					 NI6527_CTRL_RISING | \
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-11-18 16:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-14 13:13 [PATCH] comedi: ni_6527: Fix coding style - use BIT macro Ranjith Thangavel
2015-11-16 14:33 ` Dan Carpenter
2015-11-18 16:02 ` Ian Abbott
  -- strict thread matches above, loose matches on Subject: below --
2015-11-16 16:56 Ranjith Thangavel
2015-11-18 16:36 ` Ian Abbott
2015-11-11 16:14 Ranjith Thangavel
2015-11-12 17:59 ` Ian Abbott
2015-11-09 17:57 Ranjith T

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.