Skip to contentSkip to conversation

Staging: comedi: fix spacing issues in ni_stc.h

PATCH In review Sage Vaillancourt 2 participants 3 messages Dec 21, 2014 1 message not in the archive Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: comedi: fix spacing issues in ni_stc.h

Patch to the ni_stc.h file that removes spaces before tabs, and adds blank lines
after declarations.

---
 drivers/staging/comedi/drivers/ni_stc.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/staging/comedi/drivers/ni_stc.h +6 -2
index bd69c3f..3b8b3c5 100644
@@ -166,7 +166,7 @@ enum Interrupt_B_Ack_Bits {
 #define AI_SCAN_IN_PROG_Pulse			_bit4
 #define AI_EXTMUX_CLK_Pulse			_bit3
 #define AI_LOCALMUX_CLK_Pulse			_bit2
-#define AI_SC_TC_Pulse			 	_bit1
+#define AI_SC_TC_Pulse				_bit1
 #define AI_CONVERT_Pulse			_bit0
 
 #define AO_Command_1_Register		9
@@ -326,6 +326,7 @@ static inline unsigned RTSI_Output_Bit(unsigned channel, int is_mseries)
 {
 	unsigned max_channel;
 	unsigned base_bit_shift;
+
 	if (is_mseries) {
 		base_bit_shift = 8;
 		max_channel = 7;
@@ -642,7 +643,7 @@ static unsigned AO_UPDATE_Output_Select(enum ao_update_output_selection
 #define G_Load_Source_Select		_bit7
 #define G_Reload_Source_Switching	_bit15
 #define G_Loading_On_Gate		_bit14
-#define G_Gate_Polarity 		_bit13
+#define G_Gate_Polarity			_bit13
 
 #define G_Counting_Once(a)		(((a)&0x03)<<10)
 #define G_Stop_Mode(a)			(((a)&0x03)<<5)
@@ -1142,6 +1143,7 @@ static inline unsigned MSeries_AI_Config_Bank_Bits(enum ni_reg_type reg_type,
 						   unsigned channel)
 {
 	unsigned bits = channel & 0x30;
+
 	if (reg_type == ni_reg_622x) {
 		if (channel & 0x40)
 			bits |= 0x400;
@@ -1191,6 +1193,7 @@ enum MSeries_PLL_Control_Bits {
 static inline unsigned MSeries_PLL_Divisor_Bits(unsigned divisor)
 {
 	static const unsigned max_divisor = 0x10;
+
 	if (divisor < 1 || divisor > max_divisor) {
 		pr_err("%s: bug, invalid divisor=%i\n", __func__, divisor);
 		return 0;
@@ -1201,6 +1204,7 @@ static inline unsigned MSeries_PLL_Divisor_Bits(unsigned divisor)
 static inline unsigned MSeries_PLL_Multiplier_Bits(unsigned multiplier)
 {
 	static const unsigned max_multiplier = 0x100;
+
 	if (multiplier < 1 || multiplier > max_multiplier) {
 		pr_err("%s: bug, invalid multiplier=%i\n", __func__,
 		       multiplier);
Signature · 1 line
2.2.0
#1 lore raw

Sage,

Quoted 3 lines · Sage Vaillancourt

Patch to the ni_stc.h file that removes spaces before tabs, and adds blank lines
after declarations.

Format your log message so it is no more than 80 characters wide (I like
72) and remove the gratuitous spacing on the second line.

Put a blank line between your log message and your Signed-off-by:

This patch is doing two things: adding blank lines and fixing spaces/tabs in a line. Break it up in to two patches.

Quoted 66 lines
---
 drivers/staging/comedi/drivers/ni_stc.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/staging/comedi/drivers/ni_stc.h +6 -2
index bd69c3f..3b8b3c5 100644
@@ -166,7 +166,7 @@ enum Interrupt_B_Ack_Bits {
 #define AI_SCAN_IN_PROG_Pulse			_bit4
 #define AI_EXTMUX_CLK_Pulse			_bit3
 #define AI_LOCALMUX_CLK_Pulse			_bit2
-#define AI_SC_TC_Pulse			 	_bit1
+#define AI_SC_TC_Pulse				_bit1
 #define AI_CONVERT_Pulse			_bit0
 
 #define AO_Command_1_Register		9
@@ -326,6 +326,7 @@ static inline unsigned RTSI_Output_Bit(unsigned channel, int is_mseries)
 {
 	unsigned max_channel;
 	unsigned base_bit_shift;
+
 	if (is_mseries) {
 		base_bit_shift = 8;
 		max_channel = 7;
@@ -642,7 +643,7 @@ static unsigned AO_UPDATE_Output_Select(enum ao_update_output_selection
 #define G_Load_Source_Select		_bit7
 #define G_Reload_Source_Switching	_bit15
 #define G_Loading_On_Gate		_bit14
-#define G_Gate_Polarity 		_bit13
+#define G_Gate_Polarity			_bit13
 
 #define G_Counting_Once(a)		(((a)&0x03)<<10)
 #define G_Stop_Mode(a)			(((a)&0x03)<<5)
@@ -1142,6 +1143,7 @@ static inline unsigned MSeries_AI_Config_Bank_Bits(enum ni_reg_type reg_type,
 						   unsigned channel)
 {
 	unsigned bits = channel & 0x30;
+
 	if (reg_type == ni_reg_622x) {
 		if (channel & 0x40)
 			bits |= 0x400;
@@ -1191,6 +1193,7 @@ enum MSeries_PLL_Control_Bits {
 static inline unsigned MSeries_PLL_Divisor_Bits(unsigned divisor)
 {
 	static const unsigned max_divisor = 0x10;
+
 	if (divisor < 1 || divisor > max_divisor) {
 		pr_err("%s: bug, invalid divisor=%i\n", __func__, divisor);
 		return 0;
@@ -1201,6 +1204,7 @@ static inline unsigned MSeries_PLL_Divisor_Bits(unsigned divisor)
 static inline unsigned MSeries_PLL_Multiplier_Bits(unsigned multiplier)
 {
 	static const unsigned max_multiplier = 0x100;
+
 	if (multiplier < 1 || multiplier > max_multiplier) {
 		pr_err("%s: bug, invalid multiplier=%i\n", __func__,
 		       multiplier);
Signature · 7 lines
2.2.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Signature · 1 line
- Jeremiah Mahler

A message that is not in the archive (sent off-list or not yet received): CAO0vjfQ7NqH-c2CjerFk0S=06FjKcdZNd2igTuwmGo0Y+x_XCw@mail.gmail.com

#3 lore raw

Sage,

Quoted 5 lines · Sage Vaillancourt

Jeremiah,

I will get this patching business eventually. When you say "gratuitous spacing" do you refer to this line?

Quoted 9 lines
Quoted 1 line

#define G_Gate_Polarity _bit13

Because it looks fine in the code, but there's a tab that's only one character wide, so when git adds its one character of formatting, the tab expands to its full 8 characters. Before my modification, a space was there instead, but I was under the impression that that was less-than-ideal practice. Would switching back to the space be preferable? And as far as width, should I add a \(enter) where necessary?

The spacing in the code was fine. I was referring to your log message (below).

Quoted 12 lines

And the blank line and two patch bit: understood, simple fix.

- Sage Vaillancourt

Quoted 6 lines · Jeremiah Mahler

Sage,

Quoted 1 line · Sage Vaillancourt

Patch to the ni_stc.h file that removes spaces before tabs, and adds

blank lines

Quoted 1 line

after declarations.

     ^^^^^^^

This was the "gratuitous spacing" I was talking about.

Quoted 86 lines
Quoted 86 lines
Quoted 1 line

Format your log message so it is no more than 80 characters wide (I like
72) and remove the gratuitous spacing on the second line.

Put a blank line between your log message and your Signed-off-by:

This patch is doing two things: adding blank lines and fixing spaces/tabs in a line. Break it up in to two patches.

Review

Quoted 5 lines
---
 drivers/staging/comedi/drivers/ni_stc.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/staging/comedi/drivers/ni_stc.h

drivers/staging/comedi/drivers/ni_stc.h static inline unsigned RTSI_Output_Bit(unsigned

Quoted 13 lines

index bd69c3f..3b8b3c5 100644

drivers/staging/comedi/drivers/ni_stc.h +1 -1
@@ -166,7 +166,7 @@ enum Interrupt_B_Ack_Bits {
 #define AI_SCAN_IN_PROG_Pulse                        _bit4
 #define AI_EXTMUX_CLK_Pulse                  _bit3
 #define AI_LOCALMUX_CLK_Pulse                        _bit2
-#define AI_SC_TC_Pulse                               _bit1
+#define AI_SC_TC_Pulse                               _bit1
 #define AI_CONVERT_Pulse                     _bit0
 
 #define AO_Command_1_Register                9
@@ -326,6 +326,7 @@ static inline unsigned RTSI_Output_Bit(unsigned

channel, int is_mseries)

drivers/staging/comedi/drivers/ni_stc.h static unsigned AO_UPDATE_Output_Select(enum

Quoted 8 lines
drivers/staging/comedi/drivers/ni_stc.h +1 -0
 {
      unsigned max_channel;
      unsigned base_bit_shift;
+
      if (is_mseries) {
              base_bit_shift = 8;
              max_channel = 7;
@@ -642,7 +643,7 @@ static unsigned AO_UPDATE_Output_Select(enum

ao_update_output_selection

drivers/staging/comedi/drivers/ni_stc.h static inline unsigned

Quoted 9 lines
drivers/staging/comedi/drivers/ni_stc.h +1 -1
 #define G_Load_Source_Select         _bit7
 #define G_Reload_Source_Switching    _bit15
 #define G_Loading_On_Gate            _bit14
-#define G_Gate_Polarity              _bit13
+#define G_Gate_Polarity                      _bit13
 
 #define G_Counting_Once(a)           (((a)&0x03)<<10)
 #define G_Stop_Mode(a)                       (((a)&0x03)<<5)
@@ -1142,6 +1143,7 @@ static inline unsigned

MSeries_AI_Config_Bank_Bits(enum ni_reg_type reg_type,

drivers/staging/comedi/drivers/ni_stc.h static inline unsigned

Quoted 16 lines
drivers/staging/comedi/drivers/ni_stc.h +2 -0
                                                 unsigned channel)
 {
      unsigned bits = channel & 0x30;
+
      if (reg_type == ni_reg_622x) {
              if (channel & 0x40)
                      bits |= 0x400;
@@ -1191,6 +1193,7 @@ enum MSeries_PLL_Control_Bits {
 static inline unsigned MSeries_PLL_Divisor_Bits(unsigned divisor)
 {
      static const unsigned max_divisor = 0x10;
+
      if (divisor < 1 || divisor > max_divisor) {
              pr_err("%s: bug, invalid divisor=%i\n", __func__, divisor);
              return 0;
@@ -1201,6 +1204,7 @@ static inline unsigned

MSeries_PLL_Divisor_Bits(unsigned divisor)

Quoted 10 lines
drivers/staging/comedi/drivers/ni_stc.h +1 -1
 static inline unsigned MSeries_PLL_Multiplier_Bits(unsigned multiplier)
 {
      static const unsigned max_multiplier = 0x100;
+
      if (multiplier < 1 || multiplier > max_multiplier) {
              pr_err("%s: bug, invalid multiplier=%i\n", __func__,
                     multiplier);
--

2.2.0

Quoted 2 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel"

in

Quoted 3 lines

the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

--
- Jeremiah Mahler

Signature · 1 line
- Jeremiah Mahler