Skip to contentSkip to conversation

Staging: comedi: addi_common.c: checkpatch.pl fixes

PATCH In review Lijo Antony 3 participants 5 messages Jan 5, 2013 – Jan 8, 2013 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Staging: comedi: addi_common.c: checkpatch.pl fixes

checkpatch.pl style fixes:
- Broken license text into 80 char lines
- fixed two space before tab issues
- Removed unnecessary braces from if-else

---
 .../staging/comedi/drivers/addi-data/addi_common.c |   26 +++++++++++++-------
 1 file changed, 17 insertions(+), 9 deletions(-)
drivers/staging/comedi/drivers/addi-data/addi_common.c +17 -9
index 90cc432..1051fa5 100644
@@ -11,13 +11,21 @@ Copyright (C) 2004,2005  ADDI-DATA GmbH for the source code of this module.
 	http://www.addi-data.com
 	[email protected]
 
-This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
 
-This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+This program is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc.,
+59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
-You should also find the complete GPL in the COPYING file accompanying this source code.
+You should also find the complete GPL in the COPYING file accompanying this
+source code.
 
 @endverbatim
 */
@@ -29,10 +37,10 @@ You should also find the complete GPL in the COPYING file accompanying this sour
   | Tel : +49 (0) 7223/9493-0     | email    : [email protected]         |
   | Fax : +49 (0) 7223/9493-92    | Internet : http://www.addi-data.com   |
   +-----------------------------------------------------------------------+
-  | Project   : ADDI DATA         | Compiler : GCC 		          |
+  | Project   : ADDI DATA         | Compiler : GCC                        |
   | Modulname : addi_common.c     | Version  : 2.96                       |
   +-------------------------------+---------------------------------------+
-  | Author    :           | Date     :                    		  |
+  | Author    :           | Date     :                                    |
   +-----------------------------------------------------------------------+
   | Description : ADDI COMMON Main Module                                 |
   +-----------------------------------------------------------------------+
@@ -167,11 +175,11 @@ static int addi_auto_attach(struct comedi_device *dev,
 	if (this_board->i_PCIEeprom) {
 		if (!(strcmp(this_board->pc_EepromChip, "S5920"))) {
 			/*  Set 3 wait stait */
-			if (!(strcmp(dev->board_name, "apci035"))) {
+			if (!(strcmp(dev->board_name, "apci035")))
 				outl(0x80808082, devpriv->i_IobaseAmcc + 0x60);
-			} else {
+			else
 				outl(0x83838383, devpriv->i_IobaseAmcc + 0x60);
-			}
+
 			/*  Enable the interrupt for the controller */
 			dw_Dummy = inl(devpriv->i_IobaseAmcc + 0x38);
 			outl(dw_Dummy | 0x2000, devpriv->i_IobaseAmcc + 0x38);
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 2/2 Staging: comedi: addi_common.h: checkpatch.pl fixes

Reduced line lengths to 80 chars by removing extra spaces.

---
 .../staging/comedi/drivers/addi-data/addi_common.h |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/staging/comedi/drivers/addi-data/addi_common.h +10 -10
index 6d8b29f94..1996a68 100644
@@ -298,7 +298,7 @@ struct addi_private {
 	unsigned char b_AiInitialisation;
 	unsigned int ui_AiActualScan;	/* how many scans we finished */
 	unsigned int ui_AiBufferPtr;	/*  data buffer ptr in samples */
-	unsigned int ui_AiNbrofChannels;	/*  how many channels is measured */
+	unsigned int ui_AiNbrofChannels; /*  how many channels is measured */
 	unsigned int ui_AiScanLength;	/*  Length of actual scanlist */
 	unsigned int ui_AiActualScanPosition;	/*  position in actual scan */
 	unsigned int *pui_AiChannelList;	/*  actual chanlist */
@@ -313,14 +313,14 @@ struct addi_private {
 	short *AiData;	/*  Pointer to sample data */
 	unsigned int ui_AiNbrofScans;	/*  number of scans to do */
 	unsigned short us_UseDma;	/*  To use Dma or not */
-	unsigned char b_DmaDoubleBuffer;	/*  we can use double buffering */
+	unsigned char b_DmaDoubleBuffer; /*  we can use double buffering */
 	unsigned int ui_DmaActualBuffer;	/*  which buffer is used now */
 	/* UPDATE-0.7.57->0.7.68 */
 	/* unsigned int               ul_DmaBufferVirtual[2]; pointers to begin of DMA buffer */
 	short *ul_DmaBufferVirtual[2];	/*  pointers to begin of DMA buffer */
 	unsigned int ul_DmaBufferHw[2];	/*  hw address of DMA buff */
-	unsigned int ui_DmaBufferSize[2];	/*  size of dma buffer in bytes */
-	unsigned int ui_DmaBufferUsesize[2];	/*  which size we may now used for transfer */
+	unsigned int ui_DmaBufferSize[2]; /*  size of dma buffer in bytes */
+	unsigned int ui_DmaBufferUsesize[2]; /* size we may use for transfer */
 	unsigned int ui_DmaBufferSamples[2];	/*  size in samples */
 	unsigned int ui_DmaBufferPages[2];	/*  number of pages in buffer */
 	unsigned char b_DigitalOutputRegister;	/*  Digital Output Register */
@@ -331,13 +331,13 @@ struct addi_private {
 	unsigned char b_ModeSelectRegister;	/*  Contain data written at iobase + 0E */
 	unsigned short us_OutputRegister;	/*  Contain data written at iobase + 0 */
 	unsigned char b_InterruptState;
-	unsigned char b_TimerInit;	/*  Specify if InitTimerWatchdog was load */
-	unsigned char b_TimerStarted;	/*  Specify if timer 2 is running or not */
+	unsigned char b_TimerInit; /*  Specify if InitTimerWatchdog was load */
+	unsigned char b_TimerStarted; /* Specify if timer 2 is running or not */
 	unsigned char b_Timer2Mode;	/*  Specify the timer 2 mode */
 	unsigned char b_Timer2Interrupt;	/* Timer2  interrupt enable or disable */
-	unsigned char b_AiCyclicAcquisition;	/*  indicate cyclic acquisition */
+	unsigned char b_AiCyclicAcquisition; /*  indicate cyclic acquisition */
 	unsigned char b_InterruptMode;	/*  eoc eos or dma */
-	unsigned char b_EocEosInterrupt;	/*  Enable disable eoc eos interrupt */
+	unsigned char b_EocEosInterrupt; /*  Enable disable eoc eos interrupt */
 	unsigned int ui_EocEosConversionTime;
 	unsigned char b_EocEosConversionTimeBase;
 	unsigned char b_SingelDiff;
@@ -353,7 +353,7 @@ struct addi_private {
 		unsigned char b_InterruptNbr;	/* Board interrupt number */
 		unsigned char b_SlotNumber;	/* PCI slot number */
 		unsigned char b_BoardVersion;
-		unsigned int dw_MolduleConfiguration[4];	/* Module config */
+		unsigned int dw_MolduleConfiguration[4];  /* Module config */
 	} s_BoardInfos;
 
 	/* Interrupt infos */
@@ -364,7 +364,7 @@ struct addi_private {
 		unsigned int ui_Write;	/* Write FIFO */
 		struct {
 			unsigned char b_OldModuleMask;
-			unsigned int ul_OldInterruptMask;	/* Interrupt mask */
+			unsigned int ul_OldInterruptMask;  /* Interrupt mask */
 			unsigned int ul_OldCounterLatchValue;	/* Interrupt counter value */
 		} s_FIFOInterruptParameters[APCI1710_SAVE_INTERRUPT];
 	} s_InterruptParameters;
Signature · 1 line
1.7.10.4
maintainer
#2 lore raw

Re: [PATCH 2/2] Staging: comedi: addi_common.h: checkpatch.pl fixes

Quoted 39 lines · Lijo Antony

Reduced line lengths to 80 chars by removing extra spaces.

---
 .../staging/comedi/drivers/addi-data/addi_common.h |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/staging/comedi/drivers/addi-data/addi_common.h +4 -4
index 6d8b29f94..1996a68 100644
@@ -298,7 +298,7 @@ struct addi_private {
 	unsigned char b_AiInitialisation;
 	unsigned int ui_AiActualScan;	/* how many scans we finished */
 	unsigned int ui_AiBufferPtr;	/*  data buffer ptr in samples */
-	unsigned int ui_AiNbrofChannels;	/*  how many channels is measured */
+	unsigned int ui_AiNbrofChannels; /*  how many channels is measured */
 	unsigned int ui_AiScanLength;	/*  Length of actual scanlist */
 	unsigned int ui_AiActualScanPosition;	/*  position in actual scan */
 	unsigned int *pui_AiChannelList;	/*  actual chanlist */
@@ -313,14 +313,14 @@ struct addi_private {
 	short *AiData;	/*  Pointer to sample data */
 	unsigned int ui_AiNbrofScans;	/*  number of scans to do */
 	unsigned short us_UseDma;	/*  To use Dma or not */
-	unsigned char b_DmaDoubleBuffer;	/*  we can use double buffering */
+	unsigned char b_DmaDoubleBuffer; /*  we can use double buffering */
 	unsigned int ui_DmaActualBuffer;	/*  which buffer is used now */
 	/* UPDATE-0.7.57->0.7.68 */
 	/* unsigned int               ul_DmaBufferVirtual[2]; pointers to begin of DMA buffer */
 	short *ul_DmaBufferVirtual[2];	/*  pointers to begin of DMA buffer */
 	unsigned int ul_DmaBufferHw[2];	/*  hw address of DMA buff */
-	unsigned int ui_DmaBufferSize[2];	/*  size of dma buffer in bytes */
-	unsigned int ui_DmaBufferUsesize[2];	/*  which size we may now used for transfer */
+	unsigned int ui_DmaBufferSize[2]; /*  size of dma buffer in bytes */
+	unsigned int ui_DmaBufferUsesize[2]; /* size we may use for transfer */
 	unsigned int ui_DmaBufferSamples[2];	/*  size in samples */
 	unsigned int ui_DmaBufferPages[2];	/*  number of pages in buffer */
 	unsigned char b_DigitalOutputRegister;	/*  Digital Output Register */

drivers/staging/comedi/drivers/addi-data/addi_common.h struct addi_private { · line 334

Quoted 6 lines
drivers/staging/comedi/drivers/addi-data/addi_common.h +1 -2
@@ -331,13 +331,13 @@ struct addi_private {
 	unsigned char b_ModeSelectRegister;	/*  Contain data written at iobase + 0E */
 	unsigned short us_OutputRegister;	/*  Contain data written at iobase + 0 */
 	unsigned char b_InterruptState;
-	unsigned char b_TimerInit;	/*  Specify if InitTimerWatchdog was load */
-	unsigned char b_TimerStarted;	/*  Specify if timer 2 is running or not */
+	unsigned char b_TimerInit; /*  Specify if InitTimerWatchdog was load */

As you didn't do this for all fields in the structure, it's not really worth doing it for just these, right?

The proper thing to do is use kerneldoc format and document it all at the top of the structure, care to do that instead?

thanks,

greg k-h

#3 lore raw

RE: [PATCH 2/2] Staging: comedi: addi_common.h: checkpatch.pl fixes

Quoted 7 lines · Greg KH
Quoted 6 lines · Lijo Antony

Reduced line lengths to 80 chars by removing extra spaces.

---
 .../staging/comedi/drivers/addi-data/addi_common.h |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

<snip>

Quoted 5 lines

As you didn't do this for all fields in the structure, it's not really worth doing it for just these, right?

The proper thing to do is use kerneldoc format and document it all at the top of the structure, care to do that instead?

Hopefully I will soon get the rest of the addi-data drivers split off of the addi_common stuff. This will effectively remove this header file so I'm not sure it's worth making patches against it.

Regards,
Hartley

#4 lore raw

Re: [PATCH 2/2] Staging: comedi: addi_common.h: checkpatch.pl fixes

Quoted 14 lines · H Hartley Sweeten
Quoted 7 lines · Greg KH
Quoted 6 lines · Lijo Antony

Reduced line lengths to 80 chars by removing extra spaces.

---
  .../staging/comedi/drivers/addi-data/addi_common.h |   20 ++++++++++----------
  1 file changed, 10 insertions(+), 10 deletions(-)

<snip>

Quoted 3 lines

As you didn't do this for all fields in the structure, it's not really worth doing it for just these, right?

Quoted 6 lines
Quoted 2 lines

The proper thing to do is use kerneldoc format and document it all at the top of the structure, care to do that instead?

Hopefully I will soon get the rest of the addi-data drivers split off of the addi_common stuff. This will effectively remove this header file so I'm not sure it's worth making patches against it.

Ok, I will wait!
If the file is still around after your cleanup, I will make changes as per Greg's suggestion.

Thanks,
-lijo