All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: comedi: ni_tio_internal.h: checkpatch.pl cleanups
@ 2012-04-17 13:59 W. Trevor King
  2012-04-18 23:57 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 5+ messages in thread
From: W. Trevor King @ 2012-04-17 13:59 UTC (permalink / raw)
  To: devel
  Cc: W. Trevor King, Ian Abbott, Mori Hess, Greg Kroah-Hartman,
	open list:STAGING SUBSYSTEM, open list

* Line wrapping to stay under 80 characters.
* No braces for single statement blocks.

Signed-off-by: W. Trevor King <wking@drexel.edu>
---
Patch against gregkh/staging's staging-next.

 drivers/staging/comedi/drivers/ni_tio_internal.h |   36 +++++++++++++--------
 1 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_tio_internal.h b/drivers/staging/comedi/drivers/ni_tio_internal.h
index c4ca537..5e00212 100644
--- a/drivers/staging/comedi/drivers/ni_tio_internal.h
+++ b/drivers/staging/comedi/drivers/ni_tio_internal.h
@@ -362,8 +362,8 @@ static inline enum ni_gpct_register NITIO_Gi_ABZ_Reg(int counter_index)
 	return 0;
 }
 
-static inline enum ni_gpct_register NITIO_Gi_Interrupt_Acknowledge_Reg(int
-								       counter_index)
+static inline enum ni_gpct_register NITIO_Gi_Interrupt_Acknowledge_Reg(
+	int counter_index)
 {
 	switch (counter_index) {
 	case 0:
@@ -407,8 +407,8 @@ static inline enum ni_gpct_register NITIO_Gi_Status_Reg(int counter_index)
 	return 0;
 }
 
-static inline enum ni_gpct_register NITIO_Gi_Interrupt_Enable_Reg(int
-								  counter_index)
+static inline enum ni_gpct_register NITIO_Gi_Interrupt_Enable_Reg(
+	int counter_index)
 {
 	switch (counter_index) {
 	case 0:
@@ -472,15 +472,22 @@ enum Gi_Counting_Mode_Reg_Bits {
 	Gi_Index_Phase_LowA_HighB = 0x1 << Gi_Index_Phase_Bitshift,
 	Gi_Index_Phase_HighA_LowB = 0x2 << Gi_Index_Phase_Bitshift,
 	Gi_Index_Phase_HighA_HighB = 0x3 << Gi_Index_Phase_Bitshift,
-	Gi_HW_Arm_Enable_Bit = 0x80,	/* from m-series example code, not documented in 660x register level manual */
-	Gi_660x_HW_Arm_Select_Mask = 0x7 << Gi_HW_Arm_Select_Shift,	/* from m-series example code, not documented in 660x register level manual */
+	/* from m-series example code, not documented in 660x register level
+	 * manual */
+	Gi_HW_Arm_Enable_Bit = 0x80,
+	/* from m-series example code, not documented in 660x register level
+	 * manual */
+	Gi_660x_HW_Arm_Select_Mask = 0x7 << Gi_HW_Arm_Select_Shift,
 	Gi_660x_Prescale_X8_Bit = 0x1000,
 	Gi_M_Series_Prescale_X8_Bit = 0x2000,
 	Gi_M_Series_HW_Arm_Select_Mask = 0x1f << Gi_HW_Arm_Select_Shift,
-	/* must be set for clocks over 40MHz, which includes synchronous counting and quadrature modes */
+	/* must be set for clocks over 40MHz, which includes synchronous
+	 * counting and quadrature modes */
 	Gi_660x_Alternate_Sync_Bit = 0x2000,
 	Gi_M_Series_Alternate_Sync_Bit = 0x4000,
-	Gi_660x_Prescale_X2_Bit = 0x4000,	/* from m-series example code, not documented in 660x register level manual */
+	/* from m-series example code, not documented in 660x register level
+	 * manual */
+	Gi_660x_Prescale_X2_Bit = 0x4000,
 	Gi_M_Series_Prescale_X2_Bit = 0x8000,
 };
 
@@ -503,7 +510,8 @@ enum Gi_Mode_Bits {
 	Gi_Level_Gating_Bits = 0x1,
 	Gi_Rising_Edge_Gating_Bits = 0x2,
 	Gi_Falling_Edge_Gating_Bits = 0x3,
-	Gi_Gate_On_Both_Edges_Bit = 0x4,	/* used in conjunction with rising edge gating mode */
+	Gi_Gate_On_Both_Edges_Bit = 0x4,	/* used in conjunction with
+						 * rising edge gating mode */
 	Gi_Trigger_Mode_for_Edge_Gate_Mask = 0x18,
 	Gi_Edge_Gate_Starts_Stops_Bits = 0x0,
 	Gi_Edge_Gate_Stops_Starts_Bits = 0x8,
@@ -686,11 +694,10 @@ static inline unsigned Gi_Gate_Interrupt_Enable_Bit(unsigned counter_index)
 {
 	unsigned bit;
 
-	if (counter_index % 2) {
+	if (counter_index % 2)
 		bit = G1_Gate_Interrupt_Enable_Bit;
-	} else {
+	else
 		bit = G0_Gate_Interrupt_Enable_Bit;
-	}
 	return bit;
 }
 
@@ -748,8 +755,9 @@ static inline void ni_tio_set_bits_transient(struct ni_gpct *counter,
 }
 
 /* ni_tio_set_bits( ) is for safely writing to registers whose bits may be
-twiddled in interrupt context, or whose software copy may be read in interrupt context.
-*/
+ * twiddled in interrupt context, or whose software copy may be read in
+ * interrupt context.
+ */
 static inline void ni_tio_set_bits(struct ni_gpct *counter,
 				   enum ni_gpct_register register_index,
 				   unsigned bit_mask, unsigned bit_values)
-- 
1.7.3.4


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

* Re: [PATCH] staging: comedi: ni_tio_internal.h: checkpatch.pl cleanups
  2012-04-17 13:59 [PATCH] staging: comedi: ni_tio_internal.h: checkpatch.pl cleanups W. Trevor King
@ 2012-04-18 23:57 ` Greg Kroah-Hartman
  2012-04-19  1:30   ` [PATCH v2 0/2] " W. Trevor King
  0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2012-04-18 23:57 UTC (permalink / raw)
  To: W. Trevor King
  Cc: devel, open list:STAGING SUBSYSTEM, Mori Hess, open list, Ian Abbott

On Tue, Apr 17, 2012 at 09:59:35AM -0400, W. Trevor King wrote:
> * Line wrapping to stay under 80 characters.
> * No braces for single statement blocks.

Please break this into 2 different patches.

Only do one thing per patch, that's the correct thing to do.

greg k-h

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

* [PATCH v2 0/2] staging: comedi: ni_tio_internal.h: checkpatch.pl cleanups
  2012-04-18 23:57 ` Greg Kroah-Hartman
@ 2012-04-19  1:30   ` W. Trevor King
  2012-04-19  1:30     ` [PATCH v2 1/2] staging: comedi: ni_tio_internal.h: checkpatch.pl line wrapping W. Trevor King
  2012-04-19  1:30     ` [PATCH v2 2/2] staging: comedi: ni_tio_internal.h: checkpatch.pl cleanups W. Trevor King
  0 siblings, 2 replies; 5+ messages in thread
From: W. Trevor King @ 2012-04-19  1:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: W. Trevor King, devel, linux-kernel

On Wed, Apr 18, 2012 at 04:57:14PM -0700, Greg Kroah-Hartman wrote:
> On Tue, Apr 17, 2012 at 09:59:35AM -0400, W. Trevor King wrote:
> > * Line wrapping to stay under 80 characters.
> > * No braces for single statement blocks.
>
> Please break this into 2 different patches.

Here you go.

> Only do one thing per patch, that's the correct thing to do.

Sorry, I was thinking "fix checkpatch.pl issues" was a single thing.  I
was also thinking that this is the kind of dumb change that has to happen,
but makes walking backwards with `git blame` annoying, so it would be
better to compress it into fewer commits ;).


W. Trevor King (2):
  staging: comedi: ni_tio_internal.h: checkpatch.pl line wrapping
  staging: comedi: ni_tio_internal.h: checkpatch.pl cleanups

 drivers/staging/comedi/drivers/ni_tio_internal.h |   36 +++++++++++++--------
 1 files changed, 22 insertions(+), 14 deletions(-)

-- 
1.7.3.4


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

* [PATCH v2 1/2] staging: comedi: ni_tio_internal.h: checkpatch.pl line wrapping
  2012-04-19  1:30   ` [PATCH v2 0/2] " W. Trevor King
@ 2012-04-19  1:30     ` W. Trevor King
  2012-04-19  1:30     ` [PATCH v2 2/2] staging: comedi: ni_tio_internal.h: checkpatch.pl cleanups W. Trevor King
  1 sibling, 0 replies; 5+ messages in thread
From: W. Trevor King @ 2012-04-19  1:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: W. Trevor King, Ian Abbott, Mori Hess, devel, linux-kernel

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 drivers/staging/comedi/drivers/ni_tio_internal.h |   31 ++++++++++++++--------
 1 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_tio_internal.h b/drivers/staging/comedi/drivers/ni_tio_internal.h
index c4ca537..f9295ec 100644
--- a/drivers/staging/comedi/drivers/ni_tio_internal.h
+++ b/drivers/staging/comedi/drivers/ni_tio_internal.h
@@ -362,8 +362,8 @@ static inline enum ni_gpct_register NITIO_Gi_ABZ_Reg(int counter_index)
 	return 0;
 }
 
-static inline enum ni_gpct_register NITIO_Gi_Interrupt_Acknowledge_Reg(int
-								       counter_index)
+static inline enum ni_gpct_register NITIO_Gi_Interrupt_Acknowledge_Reg(
+	int counter_index)
 {
 	switch (counter_index) {
 	case 0:
@@ -407,8 +407,8 @@ static inline enum ni_gpct_register NITIO_Gi_Status_Reg(int counter_index)
 	return 0;
 }
 
-static inline enum ni_gpct_register NITIO_Gi_Interrupt_Enable_Reg(int
-								  counter_index)
+static inline enum ni_gpct_register NITIO_Gi_Interrupt_Enable_Reg(
+	int counter_index)
 {
 	switch (counter_index) {
 	case 0:
@@ -472,15 +472,22 @@ enum Gi_Counting_Mode_Reg_Bits {
 	Gi_Index_Phase_LowA_HighB = 0x1 << Gi_Index_Phase_Bitshift,
 	Gi_Index_Phase_HighA_LowB = 0x2 << Gi_Index_Phase_Bitshift,
 	Gi_Index_Phase_HighA_HighB = 0x3 << Gi_Index_Phase_Bitshift,
-	Gi_HW_Arm_Enable_Bit = 0x80,	/* from m-series example code, not documented in 660x register level manual */
-	Gi_660x_HW_Arm_Select_Mask = 0x7 << Gi_HW_Arm_Select_Shift,	/* from m-series example code, not documented in 660x register level manual */
+	/* from m-series example code, not documented in 660x register level
+	 * manual */
+	Gi_HW_Arm_Enable_Bit = 0x80,
+	/* from m-series example code, not documented in 660x register level
+	 * manual */
+	Gi_660x_HW_Arm_Select_Mask = 0x7 << Gi_HW_Arm_Select_Shift,
 	Gi_660x_Prescale_X8_Bit = 0x1000,
 	Gi_M_Series_Prescale_X8_Bit = 0x2000,
 	Gi_M_Series_HW_Arm_Select_Mask = 0x1f << Gi_HW_Arm_Select_Shift,
-	/* must be set for clocks over 40MHz, which includes synchronous counting and quadrature modes */
+	/* must be set for clocks over 40MHz, which includes synchronous
+	 * counting and quadrature modes */
 	Gi_660x_Alternate_Sync_Bit = 0x2000,
 	Gi_M_Series_Alternate_Sync_Bit = 0x4000,
-	Gi_660x_Prescale_X2_Bit = 0x4000,	/* from m-series example code, not documented in 660x register level manual */
+	/* from m-series example code, not documented in 660x register level
+	 * manual */
+	Gi_660x_Prescale_X2_Bit = 0x4000,
 	Gi_M_Series_Prescale_X2_Bit = 0x8000,
 };
 
@@ -503,7 +510,8 @@ enum Gi_Mode_Bits {
 	Gi_Level_Gating_Bits = 0x1,
 	Gi_Rising_Edge_Gating_Bits = 0x2,
 	Gi_Falling_Edge_Gating_Bits = 0x3,
-	Gi_Gate_On_Both_Edges_Bit = 0x4,	/* used in conjunction with rising edge gating mode */
+	Gi_Gate_On_Both_Edges_Bit = 0x4,	/* used in conjunction with
+						 * rising edge gating mode */
 	Gi_Trigger_Mode_for_Edge_Gate_Mask = 0x18,
 	Gi_Edge_Gate_Starts_Stops_Bits = 0x0,
 	Gi_Edge_Gate_Stops_Starts_Bits = 0x8,
@@ -748,8 +756,9 @@ static inline void ni_tio_set_bits_transient(struct ni_gpct *counter,
 }
 
 /* ni_tio_set_bits( ) is for safely writing to registers whose bits may be
-twiddled in interrupt context, or whose software copy may be read in interrupt context.
-*/
+ * twiddled in interrupt context, or whose software copy may be read in
+ * interrupt context.
+ */
 static inline void ni_tio_set_bits(struct ni_gpct *counter,
 				   enum ni_gpct_register register_index,
 				   unsigned bit_mask, unsigned bit_values)
-- 
1.7.3.4


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

* [PATCH v2 2/2] staging: comedi: ni_tio_internal.h: checkpatch.pl cleanups
  2012-04-19  1:30   ` [PATCH v2 0/2] " W. Trevor King
  2012-04-19  1:30     ` [PATCH v2 1/2] staging: comedi: ni_tio_internal.h: checkpatch.pl line wrapping W. Trevor King
@ 2012-04-19  1:30     ` W. Trevor King
  1 sibling, 0 replies; 5+ messages in thread
From: W. Trevor King @ 2012-04-19  1:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: W. Trevor King, Ian Abbott, Mori Hess, devel, linux-kernel

* No braces for single statement blocks.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 drivers/staging/comedi/drivers/ni_tio_internal.h |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_tio_internal.h b/drivers/staging/comedi/drivers/ni_tio_internal.h
index f9295ec..5e00212 100644
--- a/drivers/staging/comedi/drivers/ni_tio_internal.h
+++ b/drivers/staging/comedi/drivers/ni_tio_internal.h
@@ -694,11 +694,10 @@ static inline unsigned Gi_Gate_Interrupt_Enable_Bit(unsigned counter_index)
 {
 	unsigned bit;
 
-	if (counter_index % 2) {
+	if (counter_index % 2)
 		bit = G1_Gate_Interrupt_Enable_Bit;
-	} else {
+	else
 		bit = G0_Gate_Interrupt_Enable_Bit;
-	}
 	return bit;
 }
 
-- 
1.7.3.4


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

end of thread, other threads:[~2012-04-19  2:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-17 13:59 [PATCH] staging: comedi: ni_tio_internal.h: checkpatch.pl cleanups W. Trevor King
2012-04-18 23:57 ` Greg Kroah-Hartman
2012-04-19  1:30   ` [PATCH v2 0/2] " W. Trevor King
2012-04-19  1:30     ` [PATCH v2 1/2] staging: comedi: ni_tio_internal.h: checkpatch.pl line wrapping W. Trevor King
2012-04-19  1:30     ` [PATCH v2 2/2] staging: comedi: ni_tio_internal.h: checkpatch.pl cleanups W. Trevor King

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.