Skip to contentSkip to conversation

staging: dgnc: Patch includes the checkpatch fixes

PATCH In review Sanidhya Solanki 5 participants 32 messages Dec 11, 2015 – Dec 15, 2015 1 message not in the archive Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: dgnc: Patch includes the checkpatch fixes

Quoted 1 line

From 1dbe78ce98037da5467d817a9db838d678b338ae Mon Sep 17 00:00:00 2001

From: Sanidhya Solanki <[email protected]>
Date: Fri, 11 Dec 2015 03:08:53 -0500
Subject: [PATCH] staging: dgnc: Patch includes the checkpatch fixes

Patch contains the checkpatch fixes as asked by the TODO. TODO file is updated as well.

---
 drivers/staging/dgnc/TODO          |   1 -
 drivers/staging/dgnc/dgnc_cls.c    |   4 +-
 drivers/staging/dgnc/dgnc_driver.c |  56 ++++-----
 drivers/staging/dgnc/dgnc_driver.h |  33 +++---
 drivers/staging/dgnc/dgnc_mgmt.c   |  28 ++---
 drivers/staging/dgnc/dgnc_neo.c    | 229 ++++++++++++++++++++++---------------
 drivers/staging/dgnc/dgnc_neo.h    |  22 ++--
 drivers/staging/dgnc/dgnc_pci.h    |   1 -
 drivers/staging/dgnc/dgnc_sysfs.c  | 163 +++++++++++++++++++++-----
 drivers/staging/dgnc/dgnc_tty.c    | 197 +++++++++++++++----------------
 drivers/staging/dgnc/digi.h        |  44 +++----
 11 files changed, 464 insertions(+), 314 deletions(-)
drivers/staging/dgnc/TODO +0 -1
index 0e0825b..0bdfd26 100644
@@ -1,4 +1,3 @@
-* checkpatch fixes
 * remove unnecessary comments
 * remove unnecessary error messages. Example kzalloc() has its
   own error message. Adding an extra one is useless.
drivers/staging/dgnc/dgnc_cls.c +2 -2
index 75040da..d312d35 100644
@@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch)
 	/* Clear out UART and FIFO */
 	readb(&ch->ch_cls_uart->txrx);
 
-	writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
-	       &ch->ch_cls_uart->isr_fcr);
+	writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
+		   UART_FCR_CLEAR_XMIT), &ch->ch_cls_uart->isr_fcr);
 	udelay(10);
 
 	ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
drivers/staging/dgnc/dgnc_driver.c +28 -28

154 lines not on this page · raw message

drivers/staging/dgnc/dgnc_driver.h +13 -20
index ce7cd9b..7bed033 100644
@@ -24,6 +24,7 @@
 #include <linux/types.h>
 #include <linux/tty.h>
 #include <linux/interrupt.h>
+#include <linux/spinlock_types.h>
 
 #include "digi.h"		/* Digi specific ioctl header */
 #include "dgnc_sysfs.h"		/* Support for SYSFS */
@@ -88,7 +89,6 @@
 #define   _POSIX_VDISABLE '\0'
 #endif
 
-
 /*
  * All the possible states the driver can be while being loaded.
  */
@@ -106,7 +106,6 @@ enum {
 	BOARD_READY
 };
 
-
 /*************************************************************************
  *
  * Structures and closely related defines.
@@ -145,7 +144,6 @@ struct board_ops {
  ************************************************************************/
 #define BD_IS_PCI_EXPRESS     0x0001	  /* Is a PCI Express board */
 
-
 /*
  *	Per-board information
  */
@@ -205,18 +203,18 @@ struct dgnc_board {
 						 * to our channels.
 						 */
 
-	struct tty_driver	SerialDriver;
-	char		SerialName[200];
-	struct tty_driver	PrintDriver;
-	char		PrintName[200];
+	struct tty_driver	serial_driver;
+	char		serial_name[200];
+	struct tty_driver	print_driver;
+	char		print_name[200];
 
-	bool		dgnc_Major_Serial_Registered;
-	bool		dgnc_Major_TransparentPrint_Registered;
+	bool		dgnc_major_serial_registered;
+	bool		dgnc_major_transparent_print_registered;
 
-	uint		dgnc_Serial_Major;
-	uint		dgnc_TransparentPrint_Major;
+	uint		dgnc_serial_major;
+	uint		dgnc_transparent_print_major;
 
-	uint		TtyRefCnt;
+	uint		tty_ref_cnt;
 
 	u16		dpatype;	/* The board "type",
 					 * as defined by DPA
@@ -241,7 +239,6 @@ struct dgnc_board {
 
 };
 
-
 /************************************************************************
  * Unit flag definitions for un_flags.
  ************************************************************************/
@@ -277,7 +274,6 @@ struct un_t {
 	struct device *un_sysfs;
 };
 
-
 /************************************************************************
  * Device flag definitions for ch_flags.
  ************************************************************************/
@@ -300,7 +296,6 @@ struct un_t {
 #define CH_FORCED_STOP  0x20000		/* Output is forcibly stopped	*/
 #define CH_FORCED_STOPI 0x40000		/* Input is forcibly stopped	*/
 
-
 /* Our Read/Error/Write queue sizes */
 #define RQUEUEMASK	0x1FFF		/* 8 K - 1 */
 #define EQUEUEMASK	0x1FFF		/* 8 K - 1 */
@@ -309,7 +304,6 @@ struct un_t {
 #define EQUEUESIZE	RQUEUESIZE
 #define WQUEUESIZE	(WQUEUEMASK + 1)
 
-
 /************************************************************************
  * Channel information structure.
  ************************************************************************/
@@ -397,7 +391,6 @@ struct channel_t {
 	ulong		ch_intr_tx;	/* Count of interrupts */
 	ulong		ch_intr_rx;	/* Count of interrupts */
 
-
 	/* /proc/<board>/<channel> entries */
 	struct proc_dir_entry *proc_entry_pointer;
 	struct dgnc_proc_entry *dgnc_channel_table;
@@ -407,12 +400,12 @@ struct channel_t {
 /*
  * Our Global Variables.
  */
-extern uint		dgnc_Major;		/* Our driver/mgmt major */
+extern uint		dgnc_major;		/* Our driver/mgmt major */
 extern int		dgnc_poll_tick;		/* Poll interval - 20 ms */
 extern spinlock_t	dgnc_global_lock;	/* Driver global spinlock */
 extern spinlock_t	dgnc_poll_lock;		/* Poll scheduling lock */
-extern uint		dgnc_NumBoards;		/* Total number of boards */
-extern struct dgnc_board	*dgnc_Board[MAXBOARDS];	/* Array of board
+extern uint		dgnc_num_boards;	/* Total number of boards */
+extern struct dgnc_board	*dgnc_board[MAXBOARDS];	/* Array of board
 							 * structs
 							 */
 
drivers/staging/dgnc/dgnc_mgmt.c +14 -14
index 518fbd5..35a9295 100644
@@ -111,7 +111,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		spin_lock_irqsave(&dgnc_global_lock, flags);
 
 		memset(&ddi, 0, sizeof(ddi));
-		ddi.dinfo_nboards = dgnc_NumBoards;
+		ddi.dinfo_nboards = dgnc_num_boards;
 		sprintf(ddi.dinfo_version, "%s", DG_PART);
 
 		spin_unlock_irqrestore(&dgnc_global_lock, flags);
@@ -131,27 +131,27 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		if (copy_from_user(&brd, uarg, sizeof(int)))
 			return -EFAULT;
 
-		if (brd < 0 || brd >= dgnc_NumBoards)
+		if (brd < 0 || brd >= dgnc_num_boards)
 			return -ENODEV;
 
 		memset(&di, 0, sizeof(di));
 
 		di.info_bdnum = brd;
 
-		spin_lock_irqsave(&dgnc_Board[brd]->bd_lock, flags);
+		spin_lock_irqsave(&dgnc_board[brd]->bd_lock, flags);
 
-		di.info_bdtype = dgnc_Board[brd]->dpatype;
-		di.info_bdstate = dgnc_Board[brd]->dpastatus;
+		di.info_bdtype = dgnc_board[brd]->dpatype;
+		di.info_bdstate = dgnc_board[brd]->dpastatus;
 		di.info_ioport = 0;
-		di.info_physaddr = (ulong)dgnc_Board[brd]->membase;
-		di.info_physsize = (ulong)dgnc_Board[brd]->membase
-			- dgnc_Board[brd]->membase_end;
-		if (dgnc_Board[brd]->state != BOARD_FAILED)
-			di.info_nports = dgnc_Board[brd]->nasync;
+		di.info_physaddr = (ulong)dgnc_board[brd]->membase;
+		di.info_physsize = (ulong)dgnc_board[brd]->membase
+			- dgnc_board[brd]->membase_end;
+		if (dgnc_board[brd]->state != BOARD_FAILED)
+			di.info_nports = dgnc_board[brd]->nasync;
 		else
 			di.info_nports = 0;
 
-		spin_unlock_irqrestore(&dgnc_Board[brd]->bd_lock, flags);
+		spin_unlock_irqrestore(&dgnc_board[brd]->bd_lock, flags);
 
 		if (copy_to_user(uarg, &di, sizeof(di)))
 			return -EFAULT;
@@ -174,14 +174,14 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		channel = ni.channel;
 
 		/* Verify boundaries on board */
-		if (board >= dgnc_NumBoards)
+		if (board >= dgnc_num_boards)
 			return -ENODEV;
 
 		/* Verify boundaries on channel */
-		if (channel >= dgnc_Board[board]->nasync)
+		if (channel >= dgnc_board[board]->nasync)
 			return -ENODEV;
 
-		ch = dgnc_Board[board]->channels[channel];
+		ch = dgnc_board[board]->channels[channel];
 
 		if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
 			return -ENODEV;
drivers/staging/dgnc/dgnc_neo.c +139 -90

521 lines not on this page · raw message

drivers/staging/dgnc/dgnc_neo.h +14 -8
index c528df5..5be232f 100644
@@ -30,7 +30,8 @@
 struct neo_uart_struct {
 	u8 txrx;		/* WR  RHR/THR - Holding Reg */
 	u8 ier;		/* WR  IER - Interrupt Enable Reg */
-	u8 isr_fcr;		/* WR  ISR/FCR - Interrupt Status Reg/Fifo Control Reg */
+	u8 isr_fcr;
+	/* WR  ISR/FCR - Interrupt Status Reg/Fifo Control Reg */
 	u8 lcr;		/* WR  LCR - Line Control Reg */
 	u8 mcr;		/* WR  MCR - Modem Control Reg */
 	u8 lsr;		/* WR  LSR - Line Status Reg */
@@ -65,8 +66,8 @@ struct neo_uart_struct {
 #define NEO_EEDO  0x80		/* Data Out is an Input Pin */
 #define NEO_EEREG 0x8E		/* offset to EEPROM control reg */
 
-
-#define NEO_VPD_IMAGESIZE 0x40	/* size of image to read from EEPROM in words */
+#define NEO_VPD_IMAGESIZE 0x40
+/* size of image to read from EEPROM in words */
 #define NEO_VPD_IMAGEBYTES (NEO_VPD_IMAGESIZE * 2)
 
 /*
@@ -109,7 +110,8 @@ struct neo_uart_struct {
 /* 17158 Extended IIR's */
 #define UART_17158_IIR_RDI_TIMEOUT	0x0C	/* Receiver data TIMEOUT */
 #define UART_17158_IIR_XONXOFF		0x10	/* Received an XON/XOFF char */
-#define UART_17158_IIR_HWFLOW_STATE_CHANGE 0x20	/* CTS/DSR or RTS/DTR state change */
+#define UART_17158_IIR_HWFLOW_STATE_CHANGE 0x20
+/* CTS/DSR or RTS/DTR state change */
 #define UART_17158_IIR_FIFO_ENABLED	0xC0	/* 16550 FIFOs are Enabled */
 
 /*
@@ -120,8 +122,10 @@ struct neo_uart_struct {
 #define UART_17158_RXRDY_TIMEOUT	0x2	/* RX Ready Timeout */
 #define UART_17158_TXRDY		0x3	/* TX Ready */
 #define UART_17158_MSR			0x4	/* Modem State Change */
-#define UART_17158_TX_AND_FIFO_CLR	0x40	/* Transmitter Holding Reg Empty */
-#define UART_17158_RX_FIFO_DATA_ERROR	0x80	/* UART detected an RX FIFO Data error */
+#define UART_17158_TX_AND_FIFO_CLR	0x40
+/* Transmitter Holding Reg Empty */
+#define UART_17158_RX_FIFO_DATA_ERROR	0x80
+/* UART detected an RX FIFO Data error */
 
 /*
  * These are the EXTENDED definitions for the 17C158's Interrupt
@@ -133,8 +137,10 @@ struct neo_uart_struct {
 #define UART_17158_EFR_RTSDTR	0x40	/* Auto RTS/DTR Flow Control Enable */
 #define UART_17158_EFR_CTSDSR	0x80	/* Auto CTS/DSR Flow COntrol Enable */
 
-#define UART_17158_XOFF_DETECT	0x1	/* Indicates whether chip saw an incoming XOFF char  */
-#define UART_17158_XON_DETECT	0x2	/* Indicates whether chip saw an incoming XON char */
+#define UART_17158_XOFF_DETECT	0x1
+/* Indicates whether chip saw an incoming XOFF char  */
+#define UART_17158_XON_DETECT	0x2
+/* Indicates whether chip saw an incoming XON char */
 
 #define UART_17158_IER_RSVD1	0x10	/* Reserved by Exar */
 #define UART_17158_IER_XOFF	0x20	/* Xoff Interrupt Enable */
drivers/staging/dgnc/dgnc_pci.h +0 -1
index 617d40d..4e170c4 100644
@@ -59,7 +59,6 @@
 #define PCI_DEVICE_NEO_EXPRESS_8RJ45_PCI_NAME	"Neo 8 PCI Express RJ45"
 #define PCI_DEVICE_NEO_EXPRESS_4_IBM_PCI_NAME	"Neo 4 PCI Express IBM"
 
-
 /* Size of Memory and I/O for PCI (4 K) */
 #define PCI_RAM_SIZE				0x1000
 
drivers/staging/dgnc/dgnc_sysfs.c +132 -31

254 lines not on this page · raw message

drivers/staging/dgnc/dgnc_tty.c +100 -97

374 lines not on this page · raw message

drivers/staging/dgnc/digi.h +22 -22

82 lines not on this page · raw message

Signature · 1 line
2.5.0
#1 lore raw
Quoted 4 lines · Sanidhya Solanki
Quoted 1 line

From 1dbe78ce98037da5467d817a9db838d678b338ae Mon Sep 17 00:00:00 2001

From: Sanidhya Solanki <[email protected]>
Date: Fri, 11 Dec 2015 03:08:53 -0500
Subject: [PATCH] staging: dgnc: Patch includes the checkpatch fixes

Don't include this stuff.

Quoted 3 lines

Patch contains the checkpatch fixes as asked by the TODO. TODO file is updated as well.

Fix one type of warning at a time. This will be a series of patches.

Quoted 7 lines
drivers/staging/dgnc/dgnc_sysfs.c +0 -1
@@ -110,7 +98,16 @@ static ssize_t dgnc_vpd_show(struct device *p, struct device_attribute *attr,
 	int count = 0;
 	int i = 0;
 
-	DGNC_VERIFY_BOARD(p, bd);

drivers/staging/dgnc/dgnc_sysfs.c static ssize_t dgnc_vpd_show(struct device *p, struct device_attribute *attr, · line 110

Quoted 10 lines
drivers/staging/dgnc/dgnc_sysfs.c +10 -0
+	do {
+		if (!p)
+			return 0;
+
+		bd = dev_get_drvdata(p);
+		if (!bd || bd->magic != DGNC_BOARD_MAGIC)
+			return 0;
+		if (bd->state != BOARD_READY)
+			return 0;
+	} while (0);

Google about why do while(0) loops are used in macros and then redo this. Mostly the patch isn't bad, but I suspect I'm going to complain about how you split up some of the long lines.

regards,
dan carpenter

#2 lore raw
Quoted 5 lines · On Fri, 11 Dec 2015 16:02:33 +0300 Dan Carpenter <[email protected]>…
Quoted 5 lines
drivers/staging/dgnc/dgnc_sysfs.c +0 -0
@@ -110,7 +98,16 @@ static ssize_t dgnc_vpd_show(struct device *p, struct device_attribute *attr,
 	int count = 0;
 	int i = 0;
 
Quoted 15 lines

drivers/staging/dgnc/dgnc_sysfs.c static ssize_t dgnc_vpd_show(struct device *p, struct device_attribute *attr, · line 110

Quoted 11 lines
drivers/staging/dgnc/dgnc_sysfs.c +10 -1
-	DGNC_VERIFY_BOARD(p, bd);
+	do {
+		if (!p)
+			return 0;
+
+		bd = dev_get_drvdata(p);
+		if (!bd || bd->magic != DGNC_BOARD_MAGIC)
+			return 0;
+		if (bd->state != BOARD_READY)
+			return 0;
+	} while (0);

Google about why do while(0) loops are used in macros and then redo this. Mostly the patch isn't bad, but I suspect I'm going to complain about how you split up some of the long lines.

Let me just be completely sure that you and I are on the same page here. The macro was used to replace the do-while loop, I replaced all instances of the macro with the the actual loop. Both pieces were originally part of the code, just using macros in place of do-while statements. Do you still want me to change it? Maybe the original author did it for a specific reason.

Thanks

#3 lore raw
Quoted 24 lines · Sanidhya Solanki
Quoted 5 lines · On Fri, 11 Dec 2015 16:02:33 +0300 Dan Carpenter <[email protected]>…
Quoted 5 lines
drivers/staging/dgnc/dgnc_sysfs.c +0 -0
@@ -110,7 +98,16 @@ static ssize_t dgnc_vpd_show(struct device *p, struct device_attribute *attr,
 	int count = 0;
 	int i = 0;
 
Quoted 15 lines

drivers/staging/dgnc/dgnc_sysfs.c static ssize_t dgnc_vpd_show(struct device *p, struct device_attribute *attr, · line 110

Quoted 11 lines
drivers/staging/dgnc/dgnc_sysfs.c +10 -1
-	DGNC_VERIFY_BOARD(p, bd);
+	do {
+		if (!p)
+			return 0;
+
+		bd = dev_get_drvdata(p);
+		if (!bd || bd->magic != DGNC_BOARD_MAGIC)
+			return 0;
+		if (bd->state != BOARD_READY)
+			return 0;
+	} while (0);

Google about why do while(0) loops are used in macros and then redo this. Mostly the patch isn't bad, but I suspect I'm going to complain about how you split up some of the long lines.

Quoted 7 lines

Let me just be completely sure that you and I are on the same page here. The macro was used to replace the do-while loop, I replaced all instances of the macro with the the actual loop. Both pieces were originally part of the code, just using macros in place of do-while statements. Do you still want me to change it? Maybe the original author did it for a specific reason.

https://www.quora.com/What-is-the-purpose-of-using-do-while-0-in-macros

Do while(0) is used to make a macro look like a function. Since we have deleted the macro we don't need the do while.

regards,
dan carpenter

#32 lore raw

Re: [PATCH: FIXED} staging: dgnc: Patch includes the checkpatch fixes

In reply to a message not in the archive
Quoted 1 line

From fa54ad27ad5ba8c90e0b42901af09423b1b3d0c7 Mon Sep 17 00:00:00 2001

From: Sanidhya Solanki <[email protected]>
Date: Fri, 11 Dec 2015 21:08:06 -0500
Subject: [PATCH] staging: dgnc: Patch includes the checkpatch fixes

Patch contains the checkpatch fixes as asked by the TODO. Unnecessary do-while() loops are removed as well.

---
 drivers/staging/dgnc/dgnc_cls.c    |   4 +-
 drivers/staging/dgnc/dgnc_driver.c |  56 ++++-----
 drivers/staging/dgnc/dgnc_driver.h |  33 +++---
 drivers/staging/dgnc/dgnc_mgmt.c   |  28 ++---
 drivers/staging/dgnc/dgnc_neo.c    | 229 ++++++++++++++++++++++---------------
 drivers/staging/dgnc/dgnc_neo.h    |  22 ++--
 drivers/staging/dgnc/dgnc_pci.h    |   1 -
 drivers/staging/dgnc/dgnc_sysfs.c  | 140 ++++++++++++++++++-----
 drivers/staging/dgnc/dgnc_tty.c    | 197 +++++++++++++++----------------
 drivers/staging/dgnc/digi.h        |  44 +++----
 10 files changed, 441 insertions(+), 313 deletions(-)
drivers/staging/dgnc/dgnc_cls.c +2 -2
index 75040da..d312d35 100644
@@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch)
 	/* Clear out UART and FIFO */
 	readb(&ch->ch_cls_uart->txrx);
 
-	writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
-	       &ch->ch_cls_uart->isr_fcr);
+	writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
+		   UART_FCR_CLEAR_XMIT), &ch->ch_cls_uart->isr_fcr);
 	udelay(10);
 
 	ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
drivers/staging/dgnc/dgnc_driver.c +28 -28

154 lines not on this page · raw message

drivers/staging/dgnc/dgnc_driver.h +13 -20
index ce7cd9b..7bed033 100644
@@ -24,6 +24,7 @@
 #include <linux/types.h>
 #include <linux/tty.h>
 #include <linux/interrupt.h>
+#include <linux/spinlock_types.h>
 
 #include "digi.h"		/* Digi specific ioctl header */
 #include "dgnc_sysfs.h"		/* Support for SYSFS */
@@ -88,7 +89,6 @@
 #define   _POSIX_VDISABLE '\0'
 #endif
 
-
 /*
  * All the possible states the driver can be while being loaded.
  */
@@ -106,7 +106,6 @@ enum {
 	BOARD_READY
 };
 
-
 /*************************************************************************
  *
  * Structures and closely related defines.
@@ -145,7 +144,6 @@ struct board_ops {
  ************************************************************************/
 #define BD_IS_PCI_EXPRESS     0x0001	  /* Is a PCI Express board */
 
-
 /*
  *	Per-board information
  */
@@ -205,18 +203,18 @@ struct dgnc_board {
 						 * to our channels.
 						 */
 
-	struct tty_driver	SerialDriver;
-	char		SerialName[200];
-	struct tty_driver	PrintDriver;
-	char		PrintName[200];
+	struct tty_driver	serial_driver;
+	char		serial_name[200];
+	struct tty_driver	print_driver;
+	char		print_name[200];
 
-	bool		dgnc_Major_Serial_Registered;
-	bool		dgnc_Major_TransparentPrint_Registered;
+	bool		dgnc_major_serial_registered;
+	bool		dgnc_major_transparent_print_registered;
 
-	uint		dgnc_Serial_Major;
-	uint		dgnc_TransparentPrint_Major;
+	uint		dgnc_serial_major;
+	uint		dgnc_transparent_print_major;
 
-	uint		TtyRefCnt;
+	uint		tty_ref_cnt;
 
 	u16		dpatype;	/* The board "type",
 					 * as defined by DPA
@@ -241,7 +239,6 @@ struct dgnc_board {
 
 };
 
-
 /************************************************************************
  * Unit flag definitions for un_flags.
  ************************************************************************/
@@ -277,7 +274,6 @@ struct un_t {
 	struct device *un_sysfs;
 };
 
-
 /************************************************************************
  * Device flag definitions for ch_flags.
  ************************************************************************/
@@ -300,7 +296,6 @@ struct un_t {
 #define CH_FORCED_STOP  0x20000		/* Output is forcibly stopped	*/
 #define CH_FORCED_STOPI 0x40000		/* Input is forcibly stopped	*/
 
-
 /* Our Read/Error/Write queue sizes */
 #define RQUEUEMASK	0x1FFF		/* 8 K - 1 */
 #define EQUEUEMASK	0x1FFF		/* 8 K - 1 */
@@ -309,7 +304,6 @@ struct un_t {
 #define EQUEUESIZE	RQUEUESIZE
 #define WQUEUESIZE	(WQUEUEMASK + 1)
 
-
 /************************************************************************
  * Channel information structure.
  ************************************************************************/
@@ -397,7 +391,6 @@ struct channel_t {
 	ulong		ch_intr_tx;	/* Count of interrupts */
 	ulong		ch_intr_rx;	/* Count of interrupts */
 
-
 	/* /proc/<board>/<channel> entries */
 	struct proc_dir_entry *proc_entry_pointer;
 	struct dgnc_proc_entry *dgnc_channel_table;
@@ -407,12 +400,12 @@ struct channel_t {
 /*
  * Our Global Variables.
  */
-extern uint		dgnc_Major;		/* Our driver/mgmt major */
+extern uint		dgnc_major;		/* Our driver/mgmt major */
 extern int		dgnc_poll_tick;		/* Poll interval - 20 ms */
 extern spinlock_t	dgnc_global_lock;	/* Driver global spinlock */
 extern spinlock_t	dgnc_poll_lock;		/* Poll scheduling lock */
-extern uint		dgnc_NumBoards;		/* Total number of boards */
-extern struct dgnc_board	*dgnc_Board[MAXBOARDS];	/* Array of board
+extern uint		dgnc_num_boards;	/* Total number of boards */
+extern struct dgnc_board	*dgnc_board[MAXBOARDS];	/* Array of board
 							 * structs
 							 */
 
drivers/staging/dgnc/dgnc_mgmt.c +14 -14
index 518fbd5..35a9295 100644
@@ -111,7 +111,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		spin_lock_irqsave(&dgnc_global_lock, flags);
 
 		memset(&ddi, 0, sizeof(ddi));
-		ddi.dinfo_nboards = dgnc_NumBoards;
+		ddi.dinfo_nboards = dgnc_num_boards;
 		sprintf(ddi.dinfo_version, "%s", DG_PART);
 
 		spin_unlock_irqrestore(&dgnc_global_lock, flags);
@@ -131,27 +131,27 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		if (copy_from_user(&brd, uarg, sizeof(int)))
 			return -EFAULT;
 
-		if (brd < 0 || brd >= dgnc_NumBoards)
+		if (brd < 0 || brd >= dgnc_num_boards)
 			return -ENODEV;
 
 		memset(&di, 0, sizeof(di));
 
 		di.info_bdnum = brd;
 
-		spin_lock_irqsave(&dgnc_Board[brd]->bd_lock, flags);
+		spin_lock_irqsave(&dgnc_board[brd]->bd_lock, flags);
 
-		di.info_bdtype = dgnc_Board[brd]->dpatype;
-		di.info_bdstate = dgnc_Board[brd]->dpastatus;
+		di.info_bdtype = dgnc_board[brd]->dpatype;
+		di.info_bdstate = dgnc_board[brd]->dpastatus;
 		di.info_ioport = 0;
-		di.info_physaddr = (ulong)dgnc_Board[brd]->membase;
-		di.info_physsize = (ulong)dgnc_Board[brd]->membase
-			- dgnc_Board[brd]->membase_end;
-		if (dgnc_Board[brd]->state != BOARD_FAILED)
-			di.info_nports = dgnc_Board[brd]->nasync;
+		di.info_physaddr = (ulong)dgnc_board[brd]->membase;
+		di.info_physsize = (ulong)dgnc_board[brd]->membase
+			- dgnc_board[brd]->membase_end;
+		if (dgnc_board[brd]->state != BOARD_FAILED)
+			di.info_nports = dgnc_board[brd]->nasync;
 		else
 			di.info_nports = 0;
 
-		spin_unlock_irqrestore(&dgnc_Board[brd]->bd_lock, flags);
+		spin_unlock_irqrestore(&dgnc_board[brd]->bd_lock, flags);
 
 		if (copy_to_user(uarg, &di, sizeof(di)))
 			return -EFAULT;
@@ -174,14 +174,14 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		channel = ni.channel;
 
 		/* Verify boundaries on board */
-		if (board >= dgnc_NumBoards)
+		if (board >= dgnc_num_boards)
 			return -ENODEV;
 
 		/* Verify boundaries on channel */
-		if (channel >= dgnc_Board[board]->nasync)
+		if (channel >= dgnc_board[board]->nasync)
 			return -ENODEV;
 
-		ch = dgnc_Board[board]->channels[channel];
+		ch = dgnc_board[board]->channels[channel];
 
 		if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
 			return -ENODEV;
drivers/staging/dgnc/dgnc_neo.c +139 -90

521 lines not on this page · raw message

drivers/staging/dgnc/dgnc_neo.h +14 -8
index c528df5..5be232f 100644
@@ -30,7 +30,8 @@
 struct neo_uart_struct {
 	u8 txrx;		/* WR  RHR/THR - Holding Reg */
 	u8 ier;		/* WR  IER - Interrupt Enable Reg */
-	u8 isr_fcr;		/* WR  ISR/FCR - Interrupt Status Reg/Fifo Control Reg */
+	u8 isr_fcr;
+	/* WR  ISR/FCR - Interrupt Status Reg/Fifo Control Reg */
 	u8 lcr;		/* WR  LCR - Line Control Reg */
 	u8 mcr;		/* WR  MCR - Modem Control Reg */
 	u8 lsr;		/* WR  LSR - Line Status Reg */
@@ -65,8 +66,8 @@ struct neo_uart_struct {
 #define NEO_EEDO  0x80		/* Data Out is an Input Pin */
 #define NEO_EEREG 0x8E		/* offset to EEPROM control reg */
 
-
-#define NEO_VPD_IMAGESIZE 0x40	/* size of image to read from EEPROM in words */
+#define NEO_VPD_IMAGESIZE 0x40
+/* size of image to read from EEPROM in words */
 #define NEO_VPD_IMAGEBYTES (NEO_VPD_IMAGESIZE * 2)
 
 /*
@@ -109,7 +110,8 @@ struct neo_uart_struct {
 /* 17158 Extended IIR's */
 #define UART_17158_IIR_RDI_TIMEOUT	0x0C	/* Receiver data TIMEOUT */
 #define UART_17158_IIR_XONXOFF		0x10	/* Received an XON/XOFF char */
-#define UART_17158_IIR_HWFLOW_STATE_CHANGE 0x20	/* CTS/DSR or RTS/DTR state change */
+#define UART_17158_IIR_HWFLOW_STATE_CHANGE 0x20
+/* CTS/DSR or RTS/DTR state change */
 #define UART_17158_IIR_FIFO_ENABLED	0xC0	/* 16550 FIFOs are Enabled */
 
 /*
@@ -120,8 +122,10 @@ struct neo_uart_struct {
 #define UART_17158_RXRDY_TIMEOUT	0x2	/* RX Ready Timeout */
 #define UART_17158_TXRDY		0x3	/* TX Ready */
 #define UART_17158_MSR			0x4	/* Modem State Change */
-#define UART_17158_TX_AND_FIFO_CLR	0x40	/* Transmitter Holding Reg Empty */
-#define UART_17158_RX_FIFO_DATA_ERROR	0x80	/* UART detected an RX FIFO Data error */
+#define UART_17158_TX_AND_FIFO_CLR	0x40
+/* Transmitter Holding Reg Empty */
+#define UART_17158_RX_FIFO_DATA_ERROR	0x80
+/* UART detected an RX FIFO Data error */
 
 /*
  * These are the EXTENDED definitions for the 17C158's Interrupt
@@ -133,8 +137,10 @@ struct neo_uart_struct {
 #define UART_17158_EFR_RTSDTR	0x40	/* Auto RTS/DTR Flow Control Enable */
 #define UART_17158_EFR_CTSDSR	0x80	/* Auto CTS/DSR Flow COntrol Enable */
 
-#define UART_17158_XOFF_DETECT	0x1	/* Indicates whether chip saw an incoming XOFF char  */
-#define UART_17158_XON_DETECT	0x2	/* Indicates whether chip saw an incoming XON char */
+#define UART_17158_XOFF_DETECT	0x1
+/* Indicates whether chip saw an incoming XOFF char  */
+#define UART_17158_XON_DETECT	0x2
+/* Indicates whether chip saw an incoming XON char */
 
 #define UART_17158_IER_RSVD1	0x10	/* Reserved by Exar */
 #define UART_17158_IER_XOFF	0x20	/* Xoff Interrupt Enable */
drivers/staging/dgnc/dgnc_pci.h +0 -1
index 617d40d..4e170c4 100644
@@ -59,7 +59,6 @@
 #define PCI_DEVICE_NEO_EXPRESS_8RJ45_PCI_NAME	"Neo 8 PCI Express RJ45"
 #define PCI_DEVICE_NEO_EXPRESS_4_IBM_PCI_NAME	"Neo 4 PCI Express IBM"
 
-
 /* Size of Memory and I/O for PCI (4 K) */
 #define PCI_RAM_SIZE				0x1000
 
drivers/staging/dgnc/dgnc_sysfs.c +109 -31

230 lines not on this page · raw message

drivers/staging/dgnc/dgnc_tty.c +100 -97

374 lines not on this page · raw message

drivers/staging/dgnc/digi.h +22 -22

82 lines not on this page · raw message

Signature · 1 line
2.5.0
#4 lore raw

Re: [PATCH] staging: dgnc: Update the TODO file

In reply to Dan Carpenter
Quoted 1 line

From ae99848ed2c054e3ec031b3014f4727f6ff94ea3 Mon Sep 17 00:00:00 2001

From: Sanidhya Solanki <[email protected]>
Date: Fri, 11 Dec 2015 21:12:35 -0500
Subject: [PATCH 2/2] staging: dgnc: Update the TODO file

Patch updates the TODO file. Line regarding checkpatch changes removed.

---
 drivers/staging/dgnc/TODO | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/dgnc/TODO +0 -1
index 0e0825b..0bdfd26 100644
@@ -1,4 +1,3 @@
-* checkpatch fixes
 * remove unnecessary comments
 * remove unnecessary error messages. Example kzalloc() has its
   own error message. Adding an extra one is useless.
Signature · 1 line
2.5.0
#5 lore raw
In reply to Dan Carpenter
Quoted 8 lines · On Fri, 11 Dec 2015 16:02:33 +0300 Dan Carpenter <[email protected]>…
Quoted 4 lines · Sanidhya Solanki
Quoted 1 line

From 1dbe78ce98037da5467d817a9db838d678b338ae Mon Sep 17 00:00:00 2001

From: Sanidhya Solanki <[email protected]>
Date: Fri, 11 Dec 2015 03:08:53 -0500
Subject: [PATCH] staging: dgnc: Patch includes the checkpatch fixes

Don't include this stuff.

Whenever I remove that part, the "git am" command gives me an error that it cannot detect patch format and the patch application fails.

Thanks for the macro information. I misunderstood initially and thought you wanted me to get rid of the entire code block included in the do-while, rather than just replacing the do-while loop with the code. I sent you an update patch that does just that and a separate patch that includes the TODO file update.

Any more errors in the code regarding parenthesis alignment are a checkpatch bug, which you can visually reconfirm.

Also, any more requests by checkpatch to further breakup the remaining long lines may further degrade readablility due to presence of arrow pointers.

Thanks

#6 lore raw
Quoted 5 lines · Sanidhya Solanki
Quoted 2 lines · On Fri, 11 Dec 2015 16:02:33 +0300 Dan Carpenter <[email protected]>…
Quoted 1 line · Sanidhya Solanki
Quoted 1 line

From 1dbe78ce98037da5467d817a9db838d678b338ae Mon Sep 17 00:00:00 2001

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

From: Sanidhya Solanki <[email protected]>
Date: Fri, 11 Dec 2015 03:08:53 -0500
Subject: [PATCH] staging: dgnc: Patch includes the checkpatch fixes

Don't include this stuff.

Whenever I remove that part, the "git am" command gives me an error that it cannot detect patch format and the patch application fails.

You first have to email the patch to yourself for git am to work.

Also you need to break the patch up into a patch series that fixes one type of issue at a time.

regards,
dan carpenter

#7 lore raw
Quoted 11 lines · Dan Carpenter
Quoted 10 lines · Sanidhya Solanki
Quoted 7 lines · On Fri, 11 Dec 2015 16:02:33 +0300 Dan Carpenter <[email protected]>…
Quoted 4 lines · Sanidhya Solanki
Quoted 1 line

From 1dbe78ce98037da5467d817a9db838d678b338ae Mon Sep 17 00:00:00 2001

From: Sanidhya Solanki <[email protected]>
Date: Fri, 11 Dec 2015 03:08:53 -0500
Subject: [PATCH] staging: dgnc: Patch includes the checkpatch fixes

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Don't include this stuff.

Whenever I remove that part, the "git am" command gives me an error that it cannot detect patch format and the patch application fails.

You first have to email the patch to yourself for git am to work.

You are not sending using git send-email. That header will be used by git send-email. Try using that.
If you still want to use claws then remove these header, mail to yourself and try git am.

regards
sudip

#8 lore raw

Thank you everyone for your concern regarding my email client.

Unfortunately, there is a bug in "git send-email" that leads to the gmail SMTP server rejecting certain patches sent by the git command. If I can replicate and fix the issue for " git am" (which I do apply after emailing to myself) I will not send the git header anymore.

This bug is well documented. It presents itself as an error in line 1351/1320 in a gitconfig file. Rest assured you will not see the git header again.

Thanks

#9 lore raw
Quoted 4 lines · Sanidhya Solanki

Thank you everyone for your concern regarding my email client.

Unfortunately, there is a bug in "git send-email" that leads to the gmail SMTP server rejecting certain patches sent by the git command.

Is it? I am using git send-email from my beginning, never faced any problem in sending patch through gmail smtp server. Can you please send me the patch (offlist), so that i can test with my setup.

regards
sudip

#10 lore raw
In reply to Dan Carpenter
Quoted 1 line

From a1635ea5e75cb2f10728ae4ddf3a21567958e98f Mon Sep 17 00:00:00 2001

From: Sanidhya Solanki <[email protected]>
Date: Sat, 12 Dec 2015 02:20:03 -0500
Subject: [PATCH] [PATCH 1/3] staging: dgnc: Patch includes the checkpatch
fixes

Patch contains the spacing fixes that checkpatch prompted for, as asked by the TODO.

---
 drivers/staging/dgnc/dgnc_cls.c    |   4 +-
 drivers/staging/dgnc/dgnc_driver.h |   8 --
 drivers/staging/dgnc/dgnc_neo.c    | 235 ++++++++++++++++++++++++-------------
 drivers/staging/dgnc/dgnc_neo.h    |  22 ++--
 drivers/staging/dgnc/dgnc_pci.h    |   1 -
 drivers/staging/dgnc/dgnc_sysfs.c  |  18 ++-
 drivers/staging/dgnc/dgnc_tty.c    |  46 +++++---
 drivers/staging/dgnc/digi.h        |  32 ++---
 8 files changed, 223 insertions(+), 143 deletions(-)
drivers/staging/dgnc/dgnc_cls.c +2 -2
index 75040da..d312d35 100644
@@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch)
 	/* Clear out UART and FIFO */
 	readb(&ch->ch_cls_uart->txrx);
 
-	writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
-	       &ch->ch_cls_uart->isr_fcr);
+	writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
+		   UART_FCR_CLEAR_XMIT), &ch->ch_cls_uart->isr_fcr);
 	udelay(10);
 
 	ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
drivers/staging/dgnc/dgnc_driver.h +0 -8
index ce7cd9b..e4be81b 100644
@@ -88,7 +88,6 @@
 #define   _POSIX_VDISABLE '\0'
 #endif
 
-
 /*
  * All the possible states the driver can be while being loaded.
  */
@@ -106,7 +105,6 @@ enum {
 	BOARD_READY
 };
 
-
 /*************************************************************************
  *
  * Structures and closely related defines.
@@ -145,7 +143,6 @@ struct board_ops {
  ************************************************************************/
 #define BD_IS_PCI_EXPRESS     0x0001	  /* Is a PCI Express board */
 
-
 /*
  *	Per-board information
  */
@@ -241,7 +238,6 @@ struct dgnc_board {
 
 };
 
-
 /************************************************************************
  * Unit flag definitions for un_flags.
  ************************************************************************/
@@ -277,7 +273,6 @@ struct un_t {
 	struct device *un_sysfs;
 };
 
-
 /************************************************************************
  * Device flag definitions for ch_flags.
  ************************************************************************/
@@ -300,7 +295,6 @@ struct un_t {
 #define CH_FORCED_STOP  0x20000		/* Output is forcibly stopped	*/
 #define CH_FORCED_STOPI 0x40000		/* Input is forcibly stopped	*/
 
-
 /* Our Read/Error/Write queue sizes */
 #define RQUEUEMASK	0x1FFF		/* 8 K - 1 */
 #define EQUEUEMASK	0x1FFF		/* 8 K - 1 */
@@ -309,7 +303,6 @@ struct un_t {
 #define EQUEUESIZE	RQUEUESIZE
 #define WQUEUESIZE	(WQUEUEMASK + 1)
 
-
 /************************************************************************
  * Channel information structure.
  ************************************************************************/
@@ -397,7 +390,6 @@ struct channel_t {
 	ulong		ch_intr_tx;	/* Count of interrupts */
 	ulong		ch_intr_rx;	/* Count of interrupts */
 
-
 	/* /proc/<board>/<channel> entries */
 	struct proc_dir_entry *proc_entry_pointer;
 	struct dgnc_proc_entry *dgnc_channel_table;
drivers/staging/dgnc/dgnc_neo.c +152 -83

561 lines not on this page · raw message

drivers/staging/dgnc/dgnc_neo.h +14 -8
index c528df5..5be232f 100644
@@ -30,7 +30,8 @@
 struct neo_uart_struct {
 	u8 txrx;		/* WR  RHR/THR - Holding Reg */
 	u8 ier;		/* WR  IER - Interrupt Enable Reg */
-	u8 isr_fcr;		/* WR  ISR/FCR - Interrupt Status Reg/Fifo Control Reg */
+	u8 isr_fcr;
+	/* WR  ISR/FCR - Interrupt Status Reg/Fifo Control Reg */
 	u8 lcr;		/* WR  LCR - Line Control Reg */
 	u8 mcr;		/* WR  MCR - Modem Control Reg */
 	u8 lsr;		/* WR  LSR - Line Status Reg */
@@ -65,8 +66,8 @@ struct neo_uart_struct {
 #define NEO_EEDO  0x80		/* Data Out is an Input Pin */
 #define NEO_EEREG 0x8E		/* offset to EEPROM control reg */
 
-
-#define NEO_VPD_IMAGESIZE 0x40	/* size of image to read from EEPROM in words */
+#define NEO_VPD_IMAGESIZE 0x40
+/* size of image to read from EEPROM in words */
 #define NEO_VPD_IMAGEBYTES (NEO_VPD_IMAGESIZE * 2)
 
 /*
@@ -109,7 +110,8 @@ struct neo_uart_struct {
 /* 17158 Extended IIR's */
 #define UART_17158_IIR_RDI_TIMEOUT	0x0C	/* Receiver data TIMEOUT */
 #define UART_17158_IIR_XONXOFF		0x10	/* Received an XON/XOFF char */
-#define UART_17158_IIR_HWFLOW_STATE_CHANGE 0x20	/* CTS/DSR or RTS/DTR state change */
+#define UART_17158_IIR_HWFLOW_STATE_CHANGE 0x20
+/* CTS/DSR or RTS/DTR state change */
 #define UART_17158_IIR_FIFO_ENABLED	0xC0	/* 16550 FIFOs are Enabled */
 
 /*
@@ -120,8 +122,10 @@ struct neo_uart_struct {
 #define UART_17158_RXRDY_TIMEOUT	0x2	/* RX Ready Timeout */
 #define UART_17158_TXRDY		0x3	/* TX Ready */
 #define UART_17158_MSR			0x4	/* Modem State Change */
-#define UART_17158_TX_AND_FIFO_CLR	0x40	/* Transmitter Holding Reg Empty */
-#define UART_17158_RX_FIFO_DATA_ERROR	0x80	/* UART detected an RX FIFO Data error */
+#define UART_17158_TX_AND_FIFO_CLR	0x40
+/* Transmitter Holding Reg Empty */
+#define UART_17158_RX_FIFO_DATA_ERROR	0x80
+/* UART detected an RX FIFO Data error */
 
 /*
  * These are the EXTENDED definitions for the 17C158's Interrupt
@@ -133,8 +137,10 @@ struct neo_uart_struct {
 #define UART_17158_EFR_RTSDTR	0x40	/* Auto RTS/DTR Flow Control Enable */
 #define UART_17158_EFR_CTSDSR	0x80	/* Auto CTS/DSR Flow COntrol Enable */
 
-#define UART_17158_XOFF_DETECT	0x1	/* Indicates whether chip saw an incoming XOFF char  */
-#define UART_17158_XON_DETECT	0x2	/* Indicates whether chip saw an incoming XON char */
+#define UART_17158_XOFF_DETECT	0x1
+/* Indicates whether chip saw an incoming XOFF char  */
+#define UART_17158_XON_DETECT	0x2
+/* Indicates whether chip saw an incoming XON char */
 
 #define UART_17158_IER_RSVD1	0x10	/* Reserved by Exar */
 #define UART_17158_IER_XOFF	0x20	/* Xoff Interrupt Enable */
drivers/staging/dgnc/dgnc_pci.h +0 -1
index 617d40d..4e170c4 100644
@@ -59,7 +59,6 @@
 #define PCI_DEVICE_NEO_EXPRESS_8RJ45_PCI_NAME	"Neo 8 PCI Express RJ45"
 #define PCI_DEVICE_NEO_EXPRESS_4_IBM_PCI_NAME	"Neo 4 PCI Express IBM"
 
-
 /* Size of Memory and I/O for PCI (4 K) */
 #define PCI_RAM_SIZE				0x1000
 
drivers/staging/dgnc/dgnc_sysfs.c +12 -6
index 74a0725..db7951f 100644
@@ -193,12 +193,18 @@ static ssize_t dgnc_ports_msignals_show(struct device *p,
 			count += snprintf(buf + count, PAGE_SIZE - count,
 				"%d %s %s %s %s %s %s\n",
 				bd->channels[i]->ch_portnum,
-				(bd->channels[i]->ch_mostat & UART_MCR_RTS) ? "RTS" : "",
-				(bd->channels[i]->ch_mistat & UART_MSR_CTS) ? "CTS" : "",
-				(bd->channels[i]->ch_mostat & UART_MCR_DTR) ? "DTR" : "",
-				(bd->channels[i]->ch_mistat & UART_MSR_DSR) ? "DSR" : "",
-				(bd->channels[i]->ch_mistat & UART_MSR_DCD) ? "DCD" : "",
-				(bd->channels[i]->ch_mistat & UART_MSR_RI)  ? "RI"  : "");
+				(bd->channels[i]->ch_mostat & UART_MCR_RTS)
+				 ? "RTS" : "",
+				(bd->channels[i]->ch_mistat & UART_MSR_CTS)
+				 ? "CTS" : "",
+				(bd->channels[i]->ch_mostat & UART_MCR_DTR)
+				 ? "DTR" : "",
+				(bd->channels[i]->ch_mistat & UART_MSR_DSR)
+				 ? "DSR" : "",
+				(bd->channels[i]->ch_mistat & UART_MSR_DCD)
+				 ? "DCD" : "",
+				(bd->channels[i]->ch_mistat & UART_MSR_RI)
+				  ? "RI"  : "");
 		} else {
 			count += snprintf(buf + count, PAGE_SIZE - count,
 				"%d\n", bd->channels[i]->ch_portnum);
drivers/staging/dgnc/dgnc_tty.c +27 -19

111 lines not on this page · raw message

drivers/staging/dgnc/digi.h +16 -16
index cf9dcae..e202aac 100644
@@ -31,21 +31,21 @@
 #endif
 
 #if !defined(TIOCMSET)
-#define	TIOCMSET	(('d'<<8) | 252)	/* set modem ctrl state	*/
-#define	TIOCMGET	(('d'<<8) | 253)	/* set modem ctrl state	*/
+#define	TIOCMSET	(('d' << 8) | 252)	/* set modem ctrl state	*/
+#define	TIOCMGET	(('d' << 8) | 253)	/* set modem ctrl state	*/
 #endif
 
 #if !defined(TIOCMBIC)
-#define	TIOCMBIC	(('d'<<8) | 254)	/* set modem ctrl state */
-#define	TIOCMBIS	(('d'<<8) | 255)	/* set modem ctrl state */
+#define	TIOCMBIC	(('d' << 8) | 254)	/* set modem ctrl state */
+#define	TIOCMBIS	(('d' << 8) | 255)	/* set modem ctrl state */
 #endif
 
-#define DIGI_GETA	(('e'<<8) | 94)		/* Read params		*/
-#define DIGI_SETA	(('e'<<8) | 95)		/* Set params		*/
-#define DIGI_SETAW	(('e'<<8) | 96)		/* Drain & set params	*/
-#define DIGI_SETAF	(('e'<<8) | 97)		/* Drain, flush & set params */
-#define DIGI_GET_NI_INFO (('d'<<8) | 250) /* Non-intelligent state info */
-#define DIGI_LOOPBACK (('d'<<8) | 252) /*
+#define DIGI_GETA	(('e' << 8) | 94)	/* Read params*/
+#define DIGI_SETA	(('e' << 8) | 95)	/* Set params*/
+#define DIGI_SETAW	(('e' << 8) | 96)	/* Drain & set params*/
+#define DIGI_SETAF	(('e' << 8) | 97)	/* Drain, flush & set params*/
+#define DIGI_GET_NI_INFO (('d' << 8) | 250) /* Non-intelligent state info */
+#define DIGI_LOOPBACK (('d' << 8) | 252) /*
 					* Enable/disable UART
 					* internal loopback
 					*/
@@ -85,7 +85,7 @@ struct digi_dinfo {
 	char		dinfo_version[16];	/* driver version       */
 };
 
-#define	DIGI_GETDD	(('d'<<8) | 248)	/* get driver info      */
+#define	DIGI_GETDD	(('d' << 8) | 248)	/* get driver info      */
 
 /************************************************************************
  * Structure used with ioctl commands for per-board information
@@ -105,7 +105,7 @@ struct digi_info {
 	char		info_reserved[7];	/* for future expansion    */
 };
 
-#define	DIGI_GETBD	(('d'<<8) | 249)	/* get board info          */
+#define	DIGI_GETBD	(('d' << 8) | 249)	/* get board info          */
 
 struct digi_getbuffer /* Struct for holding buffer use counts */
 {
@@ -133,10 +133,10 @@ struct digi_getcounter {
 #define DIGI_SETCUSTOMBAUD _IOW('e', 106, int)	/* Set integer baud rate */
 #define DIGI_GETCUSTOMBAUD _IOR('e', 107, int)	/* Get integer baud rate */
 
-#define DIGI_REALPORT_GETBUFFERS (('e'<<8) | 108)
-#define DIGI_REALPORT_SENDIMMEDIATE (('e'<<8) | 109)
-#define DIGI_REALPORT_GETCOUNTERS (('e'<<8) | 110)
-#define DIGI_REALPORT_GETEVENTS (('e'<<8) | 111)
+#define DIGI_REALPORT_GETBUFFERS (('e' << 8) | 108)
+#define DIGI_REALPORT_SENDIMMEDIATE (('e' << 8) | 109)
+#define DIGI_REALPORT_GETCOUNTERS (('e' << 8) | 110)
+#define DIGI_REALPORT_GETEVENTS (('e' << 8) | 111)
 
 #define EV_OPU 0x0001 /* !<Output paused by client */
 #define EV_OPS 0x0002 /* !<Output paused by reqular sw flowctrl */
Signature · 1 line
2.5.0
#28 lore raw
In reply to Dan Carpenter

Patch contains the CamelCase fixes & Macro fixes that checkpatch prompted for, as asked by the TODO.

---
 drivers/staging/dgnc/dgnc_driver.c |  56 ++++-----
 drivers/staging/dgnc/dgnc_driver.h |  25 ++--
 drivers/staging/dgnc/dgnc_mgmt.c   |  28 ++---
 drivers/staging/dgnc/dgnc_neo.c    | 226 +++++++++++++++++--------------------
 drivers/staging/dgnc/dgnc_sysfs.c  | 134 +++++++++++++++++-----
 drivers/staging/dgnc/dgnc_tty.c    | 197 ++++++++++++++++----------------
 drivers/staging/dgnc/digi.h        |  20 ++--
 7 files changed, 367 insertions(+), 319 deletions(-)
drivers/staging/dgnc/dgnc_driver.c +28 -28
index fc6d298..37fb8f9 100644
@@ -48,7 +48,7 @@ static void		dgnc_do_remap(struct dgnc_board *brd);
 /*
  * File operations permitted on Control/Management major.
  */
-static const struct file_operations dgnc_BoardFops = {
+static const struct file_operations dgnc_board_fops = {
 	.owner		=	THIS_MODULE,
 	.unlocked_ioctl =	dgnc_mgmt_ioctl,
 	.open		=	dgnc_mgmt_open,
@@ -58,11 +58,11 @@ static const struct file_operations dgnc_BoardFops = {
 /*
  * Globals
  */
-uint			dgnc_NumBoards;
-struct dgnc_board		*dgnc_Board[MAXBOARDS];
+uint			dgnc_num_boards;
+struct dgnc_board		*dgnc_board[MAXBOARDS];
 DEFINE_SPINLOCK(dgnc_global_lock);
 DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
-uint			dgnc_Major;
+uint			dgnc_major;
 int			dgnc_poll_tick = 20;	/* Poll interval - 20 ms */
 
 /*
@@ -92,7 +92,7 @@ struct board_id {
 	unsigned int is_pci_express;
 };
 
-static struct board_id dgnc_Ids[] = {
+static struct board_id dgnc_ids[] = {
 	{	PCI_DEVICE_CLASSIC_4_PCI_NAME,		4,	0	},
 	{	PCI_DEVICE_CLASSIC_4_422_PCI_NAME,	4,	0	},
 	{	PCI_DEVICE_CLASSIC_8_PCI_NAME,		8,	0	},
@@ -144,19 +144,19 @@ static void dgnc_cleanup_module(void)
 
 	dgnc_remove_driver_sysfiles(&dgnc_driver);
 
-	device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+	device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
 	class_destroy(dgnc_class);
-	unregister_chrdev(dgnc_Major, "dgnc");
+	unregister_chrdev(dgnc_major, "dgnc");
 
-	for (i = 0; i < dgnc_NumBoards; ++i) {
-		dgnc_remove_ports_sysfiles(dgnc_Board[i]);
-		dgnc_tty_uninit(dgnc_Board[i]);
-		dgnc_cleanup_board(dgnc_Board[i]);
+	for (i = 0; i < dgnc_num_boards; ++i) {
+		dgnc_remove_ports_sysfiles(dgnc_board[i]);
+		dgnc_tty_uninit(dgnc_board[i]);
+		dgnc_cleanup_board(dgnc_board[i]);
 	}
 
 	dgnc_tty_post_uninit();
 
-	if (dgnc_NumBoards)
+	if (dgnc_num_boards)
 		pci_unregister_driver(&dgnc_driver);
 }
 
@@ -187,7 +187,7 @@ static int __init dgnc_init_module(void)
 	 */
 	if (rc < 0) {
 		/* Only unregister if it was actually registered. */
-		if (dgnc_NumBoards)
+		if (dgnc_num_boards)
 			pci_unregister_driver(&dgnc_driver);
 		else
 			pr_warn("WARNING: dgnc driver load failed.  No Digi Neo or Classic boards found.\n");
@@ -222,12 +222,12 @@ static int dgnc_start(void)
 	 *
 	 * Register management/dpa devices
 	 */
-	rc = register_chrdev(0, "dgnc", &dgnc_BoardFops);
+	rc = register_chrdev(0, "dgnc", &dgnc_board_fops);
 	if (rc < 0) {
 		pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc);
 		return rc;
 	}
-	dgnc_Major = rc;
+	dgnc_major = rc;
 
 	dgnc_class = class_create(THIS_MODULE, "dgnc_mgmt");
 	if (IS_ERR(dgnc_class)) {
@@ -237,7 +237,7 @@ static int dgnc_start(void)
 	}
 
 	dev = device_create(dgnc_class, NULL,
-			    MKDEV(dgnc_Major, 0),
+			    MKDEV(dgnc_major, 0),
 			NULL, "dgnc_mgmt");
 	if (IS_ERR(dev)) {
 		rc = PTR_ERR(dev);
@@ -267,11 +267,11 @@ static int dgnc_start(void)
 	return 0;
 
 failed_tty:
-	device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+	device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
 failed_device:
 	class_destroy(dgnc_class);
 failed_class:
-	unregister_chrdev(dgnc_Major, "dgnc");
+	unregister_chrdev(dgnc_major, "dgnc");
 	return rc;
 }
 
@@ -288,7 +288,7 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	} else {
 		rc = dgnc_found_board(pdev, ent->driver_data);
 		if (rc == 0)
-			dgnc_NumBoards++;
+			dgnc_num_boards++;
 	}
 	return rc;
 }
@@ -351,7 +351,7 @@ static void dgnc_cleanup_board(struct dgnc_board *brd)
 		}
 	}
 
-	dgnc_Board[brd->boardnum] = NULL;
+	dgnc_board[brd->boardnum] = NULL;
 
 	kfree(brd);
 }
@@ -370,8 +370,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 	unsigned long flags;
 
 	/* get the board structure and prep it */
-	dgnc_Board[dgnc_NumBoards] = kzalloc(sizeof(*brd), GFP_KERNEL);
-	brd = dgnc_Board[dgnc_NumBoards];
+	dgnc_board[dgnc_num_boards] = kzalloc(sizeof(*brd), GFP_KERNEL);
+	brd = dgnc_board[dgnc_num_boards];
 
 	if (!brd)
 		return -ENOMEM;
@@ -387,15 +387,15 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 
 	/* store the info for the board we've found */
 	brd->magic = DGNC_BOARD_MAGIC;
-	brd->boardnum = dgnc_NumBoards;
+	brd->boardnum = dgnc_num_boards;
 	brd->vendor = dgnc_pci_tbl[id].vendor;
 	brd->device = dgnc_pci_tbl[id].device;
 	brd->pdev = pdev;
 	brd->pci_bus = pdev->bus->number;
 	brd->pci_slot = PCI_SLOT(pdev->devfn);
-	brd->name = dgnc_Ids[id].name;
-	brd->maxports = dgnc_Ids[id].maxports;
-	if (dgnc_Ids[i].is_pci_express)
+	brd->name = dgnc_ids[id].name;
+	brd->maxports = dgnc_ids[id].maxports;
+	if (dgnc_ids[i].is_pci_express)
 		brd->bd_flags |= BD_IS_PCI_EXPRESS;
 	brd->dpastatus = BD_NOFEP;
 	init_waitqueue_head(&brd->state_wait);
@@ -647,8 +647,8 @@ static void dgnc_poll_handler(ulong dummy)
 	unsigned long new_time;
 
 	/* Go thru each board, kicking off a tasklet for each if needed */
-	for (i = 0; i < dgnc_NumBoards; i++) {
-		brd = dgnc_Board[i];
+	for (i = 0; i < dgnc_num_boards; i++) {
+		brd = dgnc_board[i];
 
 		spin_lock_irqsave(&brd->bd_lock, flags);
 
drivers/staging/dgnc/dgnc_driver.h +13 -12
index e4be81b..7bed033 100644
@@ -24,6 +24,7 @@
 #include <linux/types.h>
 #include <linux/tty.h>
 #include <linux/interrupt.h>
+#include <linux/spinlock_types.h>
 
 #include "digi.h"		/* Digi specific ioctl header */
 #include "dgnc_sysfs.h"		/* Support for SYSFS */
@@ -202,18 +203,18 @@ struct dgnc_board {
 						 * to our channels.
 						 */
 
-	struct tty_driver	SerialDriver;
-	char		SerialName[200];
-	struct tty_driver	PrintDriver;
-	char		PrintName[200];
+	struct tty_driver	serial_driver;
+	char		serial_name[200];
+	struct tty_driver	print_driver;
+	char		print_name[200];
 
-	bool		dgnc_Major_Serial_Registered;
-	bool		dgnc_Major_TransparentPrint_Registered;
+	bool		dgnc_major_serial_registered;
+	bool		dgnc_major_transparent_print_registered;
 
-	uint		dgnc_Serial_Major;
-	uint		dgnc_TransparentPrint_Major;
+	uint		dgnc_serial_major;
+	uint		dgnc_transparent_print_major;
 
-	uint		TtyRefCnt;
+	uint		tty_ref_cnt;
 
 	u16		dpatype;	/* The board "type",
 					 * as defined by DPA
@@ -399,12 +400,12 @@ struct channel_t {
 /*
  * Our Global Variables.
  */
-extern uint		dgnc_Major;		/* Our driver/mgmt major */
+extern uint		dgnc_major;		/* Our driver/mgmt major */
 extern int		dgnc_poll_tick;		/* Poll interval - 20 ms */
 extern spinlock_t	dgnc_global_lock;	/* Driver global spinlock */
 extern spinlock_t	dgnc_poll_lock;		/* Poll scheduling lock */
-extern uint		dgnc_NumBoards;		/* Total number of boards */
-extern struct dgnc_board	*dgnc_Board[MAXBOARDS];	/* Array of board
+extern uint		dgnc_num_boards;	/* Total number of boards */
+extern struct dgnc_board	*dgnc_board[MAXBOARDS];	/* Array of board
 							 * structs
 							 */
 
drivers/staging/dgnc/dgnc_mgmt.c +14 -14
index 518fbd5..35a9295 100644
@@ -111,7 +111,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		spin_lock_irqsave(&dgnc_global_lock, flags);
 
 		memset(&ddi, 0, sizeof(ddi));
-		ddi.dinfo_nboards = dgnc_NumBoards;
+		ddi.dinfo_nboards = dgnc_num_boards;
 		sprintf(ddi.dinfo_version, "%s", DG_PART);
 
 		spin_unlock_irqrestore(&dgnc_global_lock, flags);
@@ -131,27 +131,27 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		if (copy_from_user(&brd, uarg, sizeof(int)))
 			return -EFAULT;
 
-		if (brd < 0 || brd >= dgnc_NumBoards)
+		if (brd < 0 || brd >= dgnc_num_boards)
 			return -ENODEV;
 
 		memset(&di, 0, sizeof(di));
 
 		di.info_bdnum = brd;
 
-		spin_lock_irqsave(&dgnc_Board[brd]->bd_lock, flags);
+		spin_lock_irqsave(&dgnc_board[brd]->bd_lock, flags);
 
-		di.info_bdtype = dgnc_Board[brd]->dpatype;
-		di.info_bdstate = dgnc_Board[brd]->dpastatus;
+		di.info_bdtype = dgnc_board[brd]->dpatype;
+		di.info_bdstate = dgnc_board[brd]->dpastatus;
 		di.info_ioport = 0;
-		di.info_physaddr = (ulong)dgnc_Board[brd]->membase;
-		di.info_physsize = (ulong)dgnc_Board[brd]->membase
-			- dgnc_Board[brd]->membase_end;
-		if (dgnc_Board[brd]->state != BOARD_FAILED)
-			di.info_nports = dgnc_Board[brd]->nasync;
+		di.info_physaddr = (ulong)dgnc_board[brd]->membase;
+		di.info_physsize = (ulong)dgnc_board[brd]->membase
+			- dgnc_board[brd]->membase_end;
+		if (dgnc_board[brd]->state != BOARD_FAILED)
+			di.info_nports = dgnc_board[brd]->nasync;
 		else
 			di.info_nports = 0;
 
-		spin_unlock_irqrestore(&dgnc_Board[brd]->bd_lock, flags);
+		spin_unlock_irqrestore(&dgnc_board[brd]->bd_lock, flags);
 
 		if (copy_to_user(uarg, &di, sizeof(di)))
 			return -EFAULT;
@@ -174,14 +174,14 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		channel = ni.channel;
 
 		/* Verify boundaries on board */
-		if (board >= dgnc_NumBoards)
+		if (board >= dgnc_num_boards)
 			return -ENODEV;
 
 		/* Verify boundaries on channel */
-		if (channel >= dgnc_Board[board]->nasync)
+		if (channel >= dgnc_board[board]->nasync)
 			return -ENODEV;
 
-		ch = dgnc_Board[board]->channels[channel];
+		ch = dgnc_board[board]->channels[channel];
 
 		if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
 			return -ENODEV;
drivers/staging/dgnc/dgnc_neo.c +103 -123

519 lines not on this page · raw message

drivers/staging/dgnc/dgnc_sysfs.c +103 -31

229 lines not on this page · raw message

drivers/staging/dgnc/dgnc_tty.c +96 -101

390 lines not on this page · raw message

drivers/staging/dgnc/digi.h +10 -10
index e202aac..701312f 100644
@@ -40,10 +40,10 @@
 #define	TIOCMBIS	(('d' << 8) | 255)	/* set modem ctrl state */
 #endif
 
-#define DIGI_GETA	(('e' << 8) | 94)	/* Read params*/
-#define DIGI_SETA	(('e' << 8) | 95)	/* Set params*/
-#define DIGI_SETAW	(('e' << 8) | 96)	/* Drain & set params*/
-#define DIGI_SETAF	(('e' << 8) | 97)	/* Drain, flush & set params*/
+#define DIGI_GETA	(('e' << 8) | 94)	/* Read params		*/
+#define DIGI_SETA	(('e' << 8) | 95)	/* Set params		*/
+#define DIGI_SETAW	(('e' << 8) | 96)	/* Drain & set params	*/
+#define DIGI_SETAF	(('e' << 8) | 97)	/* Drain, flush & set params */
 #define DIGI_GET_NI_INFO (('d' << 8) | 250) /* Non-intelligent state info */
 #define DIGI_LOOPBACK (('d' << 8) | 252) /*
 					* Enable/disable UART
@@ -94,10 +94,10 @@ struct digi_dinfo {
  ************************************************************************/
 struct digi_info {
 	unsigned int	info_bdnum;		/* Board number (0 based)  */
-	unsigned int	info_ioport;		/* io port address         */
-	unsigned int	info_physaddr;		/* memory address          */
-	unsigned int	info_physsize;		/* Size of host mem window */
-	unsigned int	info_memsize;		/* Amount of dual-port mem */
+	unsigned int	info_ioport;	/* io port address         */
+	unsigned int	info_physaddr;	/* memory address          */
+	unsigned int	info_physsize;	/* Size of host mem window */
+	unsigned int	info_memsize;	/* Amount of dual-port mem */
 						/* on board                */
 	unsigned short	info_bdtype;		/* Board type              */
 	unsigned short	info_nports;		/* number of ports         */
@@ -109,8 +109,8 @@ struct digi_info {
 
 struct digi_getbuffer /* Struct for holding buffer use counts */
 {
-	unsigned long tIn;
-	unsigned long tOut;
+	unsigned long t_in;
+	unsigned long t_out;
 	unsigned long rxbuf;
 	unsigned long txbuf;
 	unsigned long txdone;
Signature · 1 line
2.5.0
#29 lore raw
In reply to Dan Carpenter

Patch updates the TODO file.

---
 drivers/staging/dgnc/TODO | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/dgnc/TODO +0 -1
index 0e0825b..0bdfd26 100644
@@ -1,4 +1,3 @@
-* checkpatch fixes
 * remove unnecessary comments
 * remove unnecessary error messages. Example kzalloc() has its
   own error message. Adding an extra one is useless.
Signature · 1 line
2.5.0
#30 lore raw
In reply to Dan Carpenter

Sorry about Patch 1/3 having the header information. The rest should be fine.

I broke up the patches as you requested.

I can also confirm that git am gives me an error if the patch to be applied does not contain the header information. Specifically, "Patch format detection failed.". Yes, this is only after I email myself the patch, reset to the cloned git directory, and then apply the patch. "git apply --check" returns no error in this scenario.

Thanks

maintainer
#11 lore raw
In reply to Sanidhya Solanki
Quoted 10 lines · Sanidhya Solanki
Quoted 1 line

From a1635ea5e75cb2f10728ae4ddf3a21567958e98f Mon Sep 17 00:00:00 2001

From: Sanidhya Solanki <[email protected]>
Date: Sat, 12 Dec 2015 02:20:03 -0500
Subject: [PATCH] [PATCH 1/3] staging: dgnc: Patch includes the checkpatch
fixes

Patch contains the spacing fixes that checkpatch prompted for, as asked by the TODO.

Please resend all of these patches properly, without the embedded email headers so that I have a chance to apply them.

thanks,

greg k-h

#12 lore raw

Patch contains the spacing fixes that checkpatch prompted for, as asked by the TODO.

---
 drivers/staging/dgnc/dgnc_cls.c    |   4 +-
 drivers/staging/dgnc/dgnc_driver.h |   8 --
 drivers/staging/dgnc/dgnc_neo.c    | 235 ++++++++++++++++++++++++-------------
 drivers/staging/dgnc/dgnc_neo.h    |  22 ++--
 drivers/staging/dgnc/dgnc_pci.h    |   1 -
 drivers/staging/dgnc/dgnc_sysfs.c  |  18 ++-
 drivers/staging/dgnc/dgnc_tty.c    |  46 +++++---
 drivers/staging/dgnc/digi.h        |  32 ++---
 8 files changed, 223 insertions(+), 143 deletions(-)
drivers/staging/dgnc/dgnc_cls.c +2 -2
index 75040da..d312d35 100644
@@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch)
 	/* Clear out UART and FIFO */
 	readb(&ch->ch_cls_uart->txrx);
 
-	writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
-	       &ch->ch_cls_uart->isr_fcr);
+	writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
+		   UART_FCR_CLEAR_XMIT), &ch->ch_cls_uart->isr_fcr);
 	udelay(10);
 
 	ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
drivers/staging/dgnc/dgnc_driver.h +0 -8
index ce7cd9b..e4be81b 100644
@@ -88,7 +88,6 @@
 #define   _POSIX_VDISABLE '\0'
 #endif
 
-
 /*
  * All the possible states the driver can be while being loaded.
  */
@@ -106,7 +105,6 @@ enum {
 	BOARD_READY
 };
 
-
 /*************************************************************************
  *
  * Structures and closely related defines.
@@ -145,7 +143,6 @@ struct board_ops {
  ************************************************************************/
 #define BD_IS_PCI_EXPRESS     0x0001	  /* Is a PCI Express board */
 
-
 /*
  *	Per-board information
  */
@@ -241,7 +238,6 @@ struct dgnc_board {
 
 };
 
-
 /************************************************************************
  * Unit flag definitions for un_flags.
  ************************************************************************/
@@ -277,7 +273,6 @@ struct un_t {
 	struct device *un_sysfs;
 };
 
-
 /************************************************************************
  * Device flag definitions for ch_flags.
  ************************************************************************/
@@ -300,7 +295,6 @@ struct un_t {
 #define CH_FORCED_STOP  0x20000		/* Output is forcibly stopped	*/
 #define CH_FORCED_STOPI 0x40000		/* Input is forcibly stopped	*/
 
-
 /* Our Read/Error/Write queue sizes */
 #define RQUEUEMASK	0x1FFF		/* 8 K - 1 */
 #define EQUEUEMASK	0x1FFF		/* 8 K - 1 */
@@ -309,7 +303,6 @@ struct un_t {
 #define EQUEUESIZE	RQUEUESIZE
 #define WQUEUESIZE	(WQUEUEMASK + 1)
 
-
 /************************************************************************
  * Channel information structure.
  ************************************************************************/
@@ -397,7 +390,6 @@ struct channel_t {
 	ulong		ch_intr_tx;	/* Count of interrupts */
 	ulong		ch_intr_rx;	/* Count of interrupts */
 
-
 	/* /proc/<board>/<channel> entries */
 	struct proc_dir_entry *proc_entry_pointer;
 	struct dgnc_proc_entry *dgnc_channel_table;
drivers/staging/dgnc/dgnc_neo.c +152 -83

561 lines not on this page · raw message

drivers/staging/dgnc/dgnc_neo.h +14 -8
index c528df5..5be232f 100644
@@ -30,7 +30,8 @@
 struct neo_uart_struct {
 	u8 txrx;		/* WR  RHR/THR - Holding Reg */
 	u8 ier;		/* WR  IER - Interrupt Enable Reg */
-	u8 isr_fcr;		/* WR  ISR/FCR - Interrupt Status Reg/Fifo Control Reg */
+	u8 isr_fcr;
+	/* WR  ISR/FCR - Interrupt Status Reg/Fifo Control Reg */
 	u8 lcr;		/* WR  LCR - Line Control Reg */
 	u8 mcr;		/* WR  MCR - Modem Control Reg */
 	u8 lsr;		/* WR  LSR - Line Status Reg */
@@ -65,8 +66,8 @@ struct neo_uart_struct {
 #define NEO_EEDO  0x80		/* Data Out is an Input Pin */
 #define NEO_EEREG 0x8E		/* offset to EEPROM control reg */
 
-
-#define NEO_VPD_IMAGESIZE 0x40	/* size of image to read from EEPROM in words */
+#define NEO_VPD_IMAGESIZE 0x40
+/* size of image to read from EEPROM in words */
 #define NEO_VPD_IMAGEBYTES (NEO_VPD_IMAGESIZE * 2)
 
 /*
@@ -109,7 +110,8 @@ struct neo_uart_struct {
 /* 17158 Extended IIR's */
 #define UART_17158_IIR_RDI_TIMEOUT	0x0C	/* Receiver data TIMEOUT */
 #define UART_17158_IIR_XONXOFF		0x10	/* Received an XON/XOFF char */
-#define UART_17158_IIR_HWFLOW_STATE_CHANGE 0x20	/* CTS/DSR or RTS/DTR state change */
+#define UART_17158_IIR_HWFLOW_STATE_CHANGE 0x20
+/* CTS/DSR or RTS/DTR state change */
 #define UART_17158_IIR_FIFO_ENABLED	0xC0	/* 16550 FIFOs are Enabled */
 
 /*
@@ -120,8 +122,10 @@ struct neo_uart_struct {
 #define UART_17158_RXRDY_TIMEOUT	0x2	/* RX Ready Timeout */
 #define UART_17158_TXRDY		0x3	/* TX Ready */
 #define UART_17158_MSR			0x4	/* Modem State Change */
-#define UART_17158_TX_AND_FIFO_CLR	0x40	/* Transmitter Holding Reg Empty */
-#define UART_17158_RX_FIFO_DATA_ERROR	0x80	/* UART detected an RX FIFO Data error */
+#define UART_17158_TX_AND_FIFO_CLR	0x40
+/* Transmitter Holding Reg Empty */
+#define UART_17158_RX_FIFO_DATA_ERROR	0x80
+/* UART detected an RX FIFO Data error */
 
 /*
  * These are the EXTENDED definitions for the 17C158's Interrupt
@@ -133,8 +137,10 @@ struct neo_uart_struct {
 #define UART_17158_EFR_RTSDTR	0x40	/* Auto RTS/DTR Flow Control Enable */
 #define UART_17158_EFR_CTSDSR	0x80	/* Auto CTS/DSR Flow COntrol Enable */
 
-#define UART_17158_XOFF_DETECT	0x1	/* Indicates whether chip saw an incoming XOFF char  */
-#define UART_17158_XON_DETECT	0x2	/* Indicates whether chip saw an incoming XON char */
+#define UART_17158_XOFF_DETECT	0x1
+/* Indicates whether chip saw an incoming XOFF char  */
+#define UART_17158_XON_DETECT	0x2
+/* Indicates whether chip saw an incoming XON char */
 
 #define UART_17158_IER_RSVD1	0x10	/* Reserved by Exar */
 #define UART_17158_IER_XOFF	0x20	/* Xoff Interrupt Enable */
drivers/staging/dgnc/dgnc_pci.h +0 -1
index 617d40d..4e170c4 100644
@@ -59,7 +59,6 @@
 #define PCI_DEVICE_NEO_EXPRESS_8RJ45_PCI_NAME	"Neo 8 PCI Express RJ45"
 #define PCI_DEVICE_NEO_EXPRESS_4_IBM_PCI_NAME	"Neo 4 PCI Express IBM"
 
-
 /* Size of Memory and I/O for PCI (4 K) */
 #define PCI_RAM_SIZE				0x1000
 
drivers/staging/dgnc/dgnc_sysfs.c +12 -6
index 74a0725..db7951f 100644
@@ -193,12 +193,18 @@ static ssize_t dgnc_ports_msignals_show(struct device *p,
 			count += snprintf(buf + count, PAGE_SIZE - count,
 				"%d %s %s %s %s %s %s\n",
 				bd->channels[i]->ch_portnum,
-				(bd->channels[i]->ch_mostat & UART_MCR_RTS) ? "RTS" : "",
-				(bd->channels[i]->ch_mistat & UART_MSR_CTS) ? "CTS" : "",
-				(bd->channels[i]->ch_mostat & UART_MCR_DTR) ? "DTR" : "",
-				(bd->channels[i]->ch_mistat & UART_MSR_DSR) ? "DSR" : "",
-				(bd->channels[i]->ch_mistat & UART_MSR_DCD) ? "DCD" : "",
-				(bd->channels[i]->ch_mistat & UART_MSR_RI)  ? "RI"  : "");
+				(bd->channels[i]->ch_mostat & UART_MCR_RTS)
+				 ? "RTS" : "",
+				(bd->channels[i]->ch_mistat & UART_MSR_CTS)
+				 ? "CTS" : "",
+				(bd->channels[i]->ch_mostat & UART_MCR_DTR)
+				 ? "DTR" : "",
+				(bd->channels[i]->ch_mistat & UART_MSR_DSR)
+				 ? "DSR" : "",
+				(bd->channels[i]->ch_mistat & UART_MSR_DCD)
+				 ? "DCD" : "",
+				(bd->channels[i]->ch_mistat & UART_MSR_RI)
+				  ? "RI"  : "");
 		} else {
 			count += snprintf(buf + count, PAGE_SIZE - count,
 				"%d\n", bd->channels[i]->ch_portnum);
drivers/staging/dgnc/dgnc_tty.c +27 -19

111 lines not on this page · raw message

drivers/staging/dgnc/digi.h +16 -16
index cf9dcae..e202aac 100644
@@ -31,21 +31,21 @@
 #endif
 
 #if !defined(TIOCMSET)
-#define	TIOCMSET	(('d'<<8) | 252)	/* set modem ctrl state	*/
-#define	TIOCMGET	(('d'<<8) | 253)	/* set modem ctrl state	*/
+#define	TIOCMSET	(('d' << 8) | 252)	/* set modem ctrl state	*/
+#define	TIOCMGET	(('d' << 8) | 253)	/* set modem ctrl state	*/
 #endif
 
 #if !defined(TIOCMBIC)
-#define	TIOCMBIC	(('d'<<8) | 254)	/* set modem ctrl state */
-#define	TIOCMBIS	(('d'<<8) | 255)	/* set modem ctrl state */
+#define	TIOCMBIC	(('d' << 8) | 254)	/* set modem ctrl state */
+#define	TIOCMBIS	(('d' << 8) | 255)	/* set modem ctrl state */
 #endif
 
-#define DIGI_GETA	(('e'<<8) | 94)		/* Read params		*/
-#define DIGI_SETA	(('e'<<8) | 95)		/* Set params		*/
-#define DIGI_SETAW	(('e'<<8) | 96)		/* Drain & set params	*/
-#define DIGI_SETAF	(('e'<<8) | 97)		/* Drain, flush & set params */
-#define DIGI_GET_NI_INFO (('d'<<8) | 250) /* Non-intelligent state info */
-#define DIGI_LOOPBACK (('d'<<8) | 252) /*
+#define DIGI_GETA	(('e' << 8) | 94)	/* Read params*/
+#define DIGI_SETA	(('e' << 8) | 95)	/* Set params*/
+#define DIGI_SETAW	(('e' << 8) | 96)	/* Drain & set params*/
+#define DIGI_SETAF	(('e' << 8) | 97)	/* Drain, flush & set params*/
+#define DIGI_GET_NI_INFO (('d' << 8) | 250) /* Non-intelligent state info */
+#define DIGI_LOOPBACK (('d' << 8) | 252) /*
 					* Enable/disable UART
 					* internal loopback
 					*/
@@ -85,7 +85,7 @@ struct digi_dinfo {
 	char		dinfo_version[16];	/* driver version       */
 };
 
-#define	DIGI_GETDD	(('d'<<8) | 248)	/* get driver info      */
+#define	DIGI_GETDD	(('d' << 8) | 248)	/* get driver info      */
 
 /************************************************************************
  * Structure used with ioctl commands for per-board information
@@ -105,7 +105,7 @@ struct digi_info {
 	char		info_reserved[7];	/* for future expansion    */
 };
 
-#define	DIGI_GETBD	(('d'<<8) | 249)	/* get board info          */
+#define	DIGI_GETBD	(('d' << 8) | 249)	/* get board info          */
 
 struct digi_getbuffer /* Struct for holding buffer use counts */
 {
@@ -133,10 +133,10 @@ struct digi_getcounter {
 #define DIGI_SETCUSTOMBAUD _IOW('e', 106, int)	/* Set integer baud rate */
 #define DIGI_GETCUSTOMBAUD _IOR('e', 107, int)	/* Get integer baud rate */
 
-#define DIGI_REALPORT_GETBUFFERS (('e'<<8) | 108)
-#define DIGI_REALPORT_SENDIMMEDIATE (('e'<<8) | 109)
-#define DIGI_REALPORT_GETCOUNTERS (('e'<<8) | 110)
-#define DIGI_REALPORT_GETEVENTS (('e'<<8) | 111)
+#define DIGI_REALPORT_GETBUFFERS (('e' << 8) | 108)
+#define DIGI_REALPORT_SENDIMMEDIATE (('e' << 8) | 109)
+#define DIGI_REALPORT_GETCOUNTERS (('e' << 8) | 110)
+#define DIGI_REALPORT_GETEVENTS (('e' << 8) | 111)
 
 #define EV_OPU 0x0001 /* !<Output paused by client */
 #define EV_OPS 0x0002 /* !<Output paused by reqular sw flowctrl */
Signature · 1 line
2.5.0
#13 lore raw
In reply to Greg KH

Patch contains the CamelCase fixes & Macro fixes that checkpatch prompted for, as asked by the TODO.

---
 drivers/staging/dgnc/dgnc_driver.c |  56 ++++-----
 drivers/staging/dgnc/dgnc_driver.h |  25 ++--
 drivers/staging/dgnc/dgnc_mgmt.c   |  28 ++---
 drivers/staging/dgnc/dgnc_neo.c    | 226 +++++++++++++++++--------------------
 drivers/staging/dgnc/dgnc_sysfs.c  | 134 +++++++++++++++++-----
 drivers/staging/dgnc/dgnc_tty.c    | 197 ++++++++++++++++----------------
 drivers/staging/dgnc/digi.h        |  20 ++--
 7 files changed, 367 insertions(+), 319 deletions(-)
drivers/staging/dgnc/dgnc_driver.c +28 -28
index fc6d298..37fb8f9 100644
@@ -48,7 +48,7 @@ static void		dgnc_do_remap(struct dgnc_board *brd);
 /*
  * File operations permitted on Control/Management major.
  */
-static const struct file_operations dgnc_BoardFops = {
+static const struct file_operations dgnc_board_fops = {
 	.owner		=	THIS_MODULE,
 	.unlocked_ioctl =	dgnc_mgmt_ioctl,
 	.open		=	dgnc_mgmt_open,
@@ -58,11 +58,11 @@ static const struct file_operations dgnc_BoardFops = {
 /*
  * Globals
  */
-uint			dgnc_NumBoards;
-struct dgnc_board		*dgnc_Board[MAXBOARDS];
+uint			dgnc_num_boards;
+struct dgnc_board		*dgnc_board[MAXBOARDS];
 DEFINE_SPINLOCK(dgnc_global_lock);
 DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
-uint			dgnc_Major;
+uint			dgnc_major;
 int			dgnc_poll_tick = 20;	/* Poll interval - 20 ms */
 
 /*
@@ -92,7 +92,7 @@ struct board_id {
 	unsigned int is_pci_express;
 };
 
-static struct board_id dgnc_Ids[] = {
+static struct board_id dgnc_ids[] = {
 	{	PCI_DEVICE_CLASSIC_4_PCI_NAME,		4,	0	},
 	{	PCI_DEVICE_CLASSIC_4_422_PCI_NAME,	4,	0	},
 	{	PCI_DEVICE_CLASSIC_8_PCI_NAME,		8,	0	},
@@ -144,19 +144,19 @@ static void dgnc_cleanup_module(void)
 
 	dgnc_remove_driver_sysfiles(&dgnc_driver);
 
-	device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+	device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
 	class_destroy(dgnc_class);
-	unregister_chrdev(dgnc_Major, "dgnc");
+	unregister_chrdev(dgnc_major, "dgnc");
 
-	for (i = 0; i < dgnc_NumBoards; ++i) {
-		dgnc_remove_ports_sysfiles(dgnc_Board[i]);
-		dgnc_tty_uninit(dgnc_Board[i]);
-		dgnc_cleanup_board(dgnc_Board[i]);
+	for (i = 0; i < dgnc_num_boards; ++i) {
+		dgnc_remove_ports_sysfiles(dgnc_board[i]);
+		dgnc_tty_uninit(dgnc_board[i]);
+		dgnc_cleanup_board(dgnc_board[i]);
 	}
 
 	dgnc_tty_post_uninit();
 
-	if (dgnc_NumBoards)
+	if (dgnc_num_boards)
 		pci_unregister_driver(&dgnc_driver);
 }
 
@@ -187,7 +187,7 @@ static int __init dgnc_init_module(void)
 	 */
 	if (rc < 0) {
 		/* Only unregister if it was actually registered. */
-		if (dgnc_NumBoards)
+		if (dgnc_num_boards)
 			pci_unregister_driver(&dgnc_driver);
 		else
 			pr_warn("WARNING: dgnc driver load failed.  No Digi Neo or Classic boards found.\n");
@@ -222,12 +222,12 @@ static int dgnc_start(void)
 	 *
 	 * Register management/dpa devices
 	 */
-	rc = register_chrdev(0, "dgnc", &dgnc_BoardFops);
+	rc = register_chrdev(0, "dgnc", &dgnc_board_fops);
 	if (rc < 0) {
 		pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc);
 		return rc;
 	}
-	dgnc_Major = rc;
+	dgnc_major = rc;
 
 	dgnc_class = class_create(THIS_MODULE, "dgnc_mgmt");
 	if (IS_ERR(dgnc_class)) {
@@ -237,7 +237,7 @@ static int dgnc_start(void)
 	}
 
 	dev = device_create(dgnc_class, NULL,
-			    MKDEV(dgnc_Major, 0),
+			    MKDEV(dgnc_major, 0),
 			NULL, "dgnc_mgmt");
 	if (IS_ERR(dev)) {
 		rc = PTR_ERR(dev);
@@ -267,11 +267,11 @@ static int dgnc_start(void)
 	return 0;
 
 failed_tty:
-	device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+	device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
 failed_device:
 	class_destroy(dgnc_class);
 failed_class:
-	unregister_chrdev(dgnc_Major, "dgnc");
+	unregister_chrdev(dgnc_major, "dgnc");
 	return rc;
 }
 
@@ -288,7 +288,7 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	} else {
 		rc = dgnc_found_board(pdev, ent->driver_data);
 		if (rc == 0)
-			dgnc_NumBoards++;
+			dgnc_num_boards++;
 	}
 	return rc;
 }
@@ -351,7 +351,7 @@ static void dgnc_cleanup_board(struct dgnc_board *brd)
 		}
 	}
 
-	dgnc_Board[brd->boardnum] = NULL;
+	dgnc_board[brd->boardnum] = NULL;
 
 	kfree(brd);
 }
@@ -370,8 +370,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 	unsigned long flags;
 
 	/* get the board structure and prep it */
-	dgnc_Board[dgnc_NumBoards] = kzalloc(sizeof(*brd), GFP_KERNEL);
-	brd = dgnc_Board[dgnc_NumBoards];
+	dgnc_board[dgnc_num_boards] = kzalloc(sizeof(*brd), GFP_KERNEL);
+	brd = dgnc_board[dgnc_num_boards];
 
 	if (!brd)
 		return -ENOMEM;
@@ -387,15 +387,15 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 
 	/* store the info for the board we've found */
 	brd->magic = DGNC_BOARD_MAGIC;
-	brd->boardnum = dgnc_NumBoards;
+	brd->boardnum = dgnc_num_boards;
 	brd->vendor = dgnc_pci_tbl[id].vendor;
 	brd->device = dgnc_pci_tbl[id].device;
 	brd->pdev = pdev;
 	brd->pci_bus = pdev->bus->number;
 	brd->pci_slot = PCI_SLOT(pdev->devfn);
-	brd->name = dgnc_Ids[id].name;
-	brd->maxports = dgnc_Ids[id].maxports;
-	if (dgnc_Ids[i].is_pci_express)
+	brd->name = dgnc_ids[id].name;
+	brd->maxports = dgnc_ids[id].maxports;
+	if (dgnc_ids[i].is_pci_express)
 		brd->bd_flags |= BD_IS_PCI_EXPRESS;
 	brd->dpastatus = BD_NOFEP;
 	init_waitqueue_head(&brd->state_wait);
@@ -647,8 +647,8 @@ static void dgnc_poll_handler(ulong dummy)
 	unsigned long new_time;
 
 	/* Go thru each board, kicking off a tasklet for each if needed */
-	for (i = 0; i < dgnc_NumBoards; i++) {
-		brd = dgnc_Board[i];
+	for (i = 0; i < dgnc_num_boards; i++) {
+		brd = dgnc_board[i];
 
 		spin_lock_irqsave(&brd->bd_lock, flags);
 
drivers/staging/dgnc/dgnc_driver.h +13 -12
index e4be81b..7bed033 100644
@@ -24,6 +24,7 @@
 #include <linux/types.h>
 #include <linux/tty.h>
 #include <linux/interrupt.h>
+#include <linux/spinlock_types.h>
 
 #include "digi.h"		/* Digi specific ioctl header */
 #include "dgnc_sysfs.h"		/* Support for SYSFS */
@@ -202,18 +203,18 @@ struct dgnc_board {
 						 * to our channels.
 						 */
 
-	struct tty_driver	SerialDriver;
-	char		SerialName[200];
-	struct tty_driver	PrintDriver;
-	char		PrintName[200];
+	struct tty_driver	serial_driver;
+	char		serial_name[200];
+	struct tty_driver	print_driver;
+	char		print_name[200];
 
-	bool		dgnc_Major_Serial_Registered;
-	bool		dgnc_Major_TransparentPrint_Registered;
+	bool		dgnc_major_serial_registered;
+	bool		dgnc_major_transparent_print_registered;
 
-	uint		dgnc_Serial_Major;
-	uint		dgnc_TransparentPrint_Major;
+	uint		dgnc_serial_major;
+	uint		dgnc_transparent_print_major;
 
-	uint		TtyRefCnt;
+	uint		tty_ref_cnt;
 
 	u16		dpatype;	/* The board "type",
 					 * as defined by DPA
@@ -399,12 +400,12 @@ struct channel_t {
 /*
  * Our Global Variables.
  */
-extern uint		dgnc_Major;		/* Our driver/mgmt major */
+extern uint		dgnc_major;		/* Our driver/mgmt major */
 extern int		dgnc_poll_tick;		/* Poll interval - 20 ms */
 extern spinlock_t	dgnc_global_lock;	/* Driver global spinlock */
 extern spinlock_t	dgnc_poll_lock;		/* Poll scheduling lock */
-extern uint		dgnc_NumBoards;		/* Total number of boards */
-extern struct dgnc_board	*dgnc_Board[MAXBOARDS];	/* Array of board
+extern uint		dgnc_num_boards;	/* Total number of boards */
+extern struct dgnc_board	*dgnc_board[MAXBOARDS];	/* Array of board
 							 * structs
 							 */
 
drivers/staging/dgnc/dgnc_mgmt.c +14 -14
index 518fbd5..35a9295 100644
@@ -111,7 +111,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		spin_lock_irqsave(&dgnc_global_lock, flags);
 
 		memset(&ddi, 0, sizeof(ddi));
-		ddi.dinfo_nboards = dgnc_NumBoards;
+		ddi.dinfo_nboards = dgnc_num_boards;
 		sprintf(ddi.dinfo_version, "%s", DG_PART);
 
 		spin_unlock_irqrestore(&dgnc_global_lock, flags);
@@ -131,27 +131,27 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		if (copy_from_user(&brd, uarg, sizeof(int)))
 			return -EFAULT;
 
-		if (brd < 0 || brd >= dgnc_NumBoards)
+		if (brd < 0 || brd >= dgnc_num_boards)
 			return -ENODEV;
 
 		memset(&di, 0, sizeof(di));
 
 		di.info_bdnum = brd;
 
-		spin_lock_irqsave(&dgnc_Board[brd]->bd_lock, flags);
+		spin_lock_irqsave(&dgnc_board[brd]->bd_lock, flags);
 
-		di.info_bdtype = dgnc_Board[brd]->dpatype;
-		di.info_bdstate = dgnc_Board[brd]->dpastatus;
+		di.info_bdtype = dgnc_board[brd]->dpatype;
+		di.info_bdstate = dgnc_board[brd]->dpastatus;
 		di.info_ioport = 0;
-		di.info_physaddr = (ulong)dgnc_Board[brd]->membase;
-		di.info_physsize = (ulong)dgnc_Board[brd]->membase
-			- dgnc_Board[brd]->membase_end;
-		if (dgnc_Board[brd]->state != BOARD_FAILED)
-			di.info_nports = dgnc_Board[brd]->nasync;
+		di.info_physaddr = (ulong)dgnc_board[brd]->membase;
+		di.info_physsize = (ulong)dgnc_board[brd]->membase
+			- dgnc_board[brd]->membase_end;
+		if (dgnc_board[brd]->state != BOARD_FAILED)
+			di.info_nports = dgnc_board[brd]->nasync;
 		else
 			di.info_nports = 0;
 
-		spin_unlock_irqrestore(&dgnc_Board[brd]->bd_lock, flags);
+		spin_unlock_irqrestore(&dgnc_board[brd]->bd_lock, flags);
 
 		if (copy_to_user(uarg, &di, sizeof(di)))
 			return -EFAULT;
@@ -174,14 +174,14 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		channel = ni.channel;
 
 		/* Verify boundaries on board */
-		if (board >= dgnc_NumBoards)
+		if (board >= dgnc_num_boards)
 			return -ENODEV;
 
 		/* Verify boundaries on channel */
-		if (channel >= dgnc_Board[board]->nasync)
+		if (channel >= dgnc_board[board]->nasync)
 			return -ENODEV;
 
-		ch = dgnc_Board[board]->channels[channel];
+		ch = dgnc_board[board]->channels[channel];
 
 		if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
 			return -ENODEV;
drivers/staging/dgnc/dgnc_neo.c +103 -123

519 lines not on this page · raw message

drivers/staging/dgnc/dgnc_sysfs.c +103 -31

229 lines not on this page · raw message

drivers/staging/dgnc/dgnc_tty.c +96 -101

390 lines not on this page · raw message

drivers/staging/dgnc/digi.h +10 -10
index e202aac..701312f 100644
@@ -40,10 +40,10 @@
 #define	TIOCMBIS	(('d' << 8) | 255)	/* set modem ctrl state */
 #endif
 
-#define DIGI_GETA	(('e' << 8) | 94)	/* Read params*/
-#define DIGI_SETA	(('e' << 8) | 95)	/* Set params*/
-#define DIGI_SETAW	(('e' << 8) | 96)	/* Drain & set params*/
-#define DIGI_SETAF	(('e' << 8) | 97)	/* Drain, flush & set params*/
+#define DIGI_GETA	(('e' << 8) | 94)	/* Read params		*/
+#define DIGI_SETA	(('e' << 8) | 95)	/* Set params		*/
+#define DIGI_SETAW	(('e' << 8) | 96)	/* Drain & set params	*/
+#define DIGI_SETAF	(('e' << 8) | 97)	/* Drain, flush & set params */
 #define DIGI_GET_NI_INFO (('d' << 8) | 250) /* Non-intelligent state info */
 #define DIGI_LOOPBACK (('d' << 8) | 252) /*
 					* Enable/disable UART
@@ -94,10 +94,10 @@ struct digi_dinfo {
  ************************************************************************/
 struct digi_info {
 	unsigned int	info_bdnum;		/* Board number (0 based)  */
-	unsigned int	info_ioport;		/* io port address         */
-	unsigned int	info_physaddr;		/* memory address          */
-	unsigned int	info_physsize;		/* Size of host mem window */
-	unsigned int	info_memsize;		/* Amount of dual-port mem */
+	unsigned int	info_ioport;	/* io port address         */
+	unsigned int	info_physaddr;	/* memory address          */
+	unsigned int	info_physsize;	/* Size of host mem window */
+	unsigned int	info_memsize;	/* Amount of dual-port mem */
 						/* on board                */
 	unsigned short	info_bdtype;		/* Board type              */
 	unsigned short	info_nports;		/* number of ports         */
@@ -109,8 +109,8 @@ struct digi_info {
 
 struct digi_getbuffer /* Struct for holding buffer use counts */
 {
-	unsigned long tIn;
-	unsigned long tOut;
+	unsigned long t_in;
+	unsigned long t_out;
 	unsigned long rxbuf;
 	unsigned long txbuf;
 	unsigned long txdone;
Signature · 1 line
2.5.0
#14 lore raw
In reply to Greg KH

Patch updates the TODO file.

---
 drivers/staging/dgnc/TODO | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/dgnc/TODO +0 -1
index 0e0825b..0bdfd26 100644
@@ -1,4 +1,3 @@
-* checkpatch fixes
 * remove unnecessary comments
 * remove unnecessary error messages. Example kzalloc() has its
   own error message. Adding an extra one is useless.
Signature · 1 line
2.5.0
maintainer
#15 lore raw
Quoted 18 lines · Sanidhya Solanki

Patch updates the TODO file.

---
 drivers/staging/dgnc/TODO | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/dgnc/TODO +0 -1
index 0e0825b..0bdfd26 100644
@@ -1,4 +1,3 @@
-* checkpatch fixes
 * remove unnecessary comments
 * remove unnecessary error messages. Example kzalloc() has its
   own error message. Adding an extra one is useless.
Signature · 1 line
2.5.0

You sent me 3 patches, all with the same Subject: line, and all of them incorrect, so I've dropped them all :(

#16 lore raw

Can you tell me what was incorrect about them?
I thought you requested the dgnc patches to be resent without the headers.
There are 3 of them because Dan Carpenter asked my patch to be broken up so each one does only one thing. I also resent you the skein subsystem patches, as I did not hear anything from you for almost a week.
Thanks

maintainer
#17 lore raw
Quoted 1 line · Sanidhya Solanki

Can you tell me what was incorrect about them?

The subjects are all wrong, go look at them... PATCH twice? 1/3 for every message? Same string for every message?

Quoted 2 lines

I thought you requested the dgnc patches to be resent without the headers.

I did, but that doesn't mean you send incorrect ones :)

Quoted 4 lines

There are 3 of them because Dan Carpenter asked my patch to be broken up so each one does only one thing. I also resent you the skein subsystem patches, as I did not hear anything from you for almost a week.

My queue of pending staging patches is over 1000 right now, they are burried somewhere in there, be patient.

greg k-h

#18 lore raw

Patch contains the spacing fixes that checkpatch prompted for, as asked by the TODO.

---
 drivers/staging/dgnc/dgnc_cls.c    |   4 +-
 drivers/staging/dgnc/dgnc_driver.h |   8 --
 drivers/staging/dgnc/dgnc_neo.c    | 235 ++++++++++++++++++++++++-------------
 drivers/staging/dgnc/dgnc_neo.h    |  22 ++--
 drivers/staging/dgnc/dgnc_pci.h    |   1 -
 drivers/staging/dgnc/dgnc_sysfs.c  |  18 ++-
 drivers/staging/dgnc/dgnc_tty.c    |  46 +++++---
 drivers/staging/dgnc/digi.h        |  32 ++---
 8 files changed, 223 insertions(+), 143 deletions(-)
drivers/staging/dgnc/dgnc_cls.c +2 -2
index 75040da..d312d35 100644
@@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch)
 	/* Clear out UART and FIFO */
 	readb(&ch->ch_cls_uart->txrx);
 
-	writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
-	       &ch->ch_cls_uart->isr_fcr);
+	writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
+		   UART_FCR_CLEAR_XMIT), &ch->ch_cls_uart->isr_fcr);
 	udelay(10);
 
 	ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
drivers/staging/dgnc/dgnc_driver.h +0 -8
index ce7cd9b..e4be81b 100644
@@ -88,7 +88,6 @@
 #define   _POSIX_VDISABLE '\0'
 #endif
 
-
 /*
  * All the possible states the driver can be while being loaded.
  */
@@ -106,7 +105,6 @@ enum {
 	BOARD_READY
 };
 
-
 /*************************************************************************
  *
  * Structures and closely related defines.
@@ -145,7 +143,6 @@ struct board_ops {
  ************************************************************************/
 #define BD_IS_PCI_EXPRESS     0x0001	  /* Is a PCI Express board */
 
-
 /*
  *	Per-board information
  */
@@ -241,7 +238,6 @@ struct dgnc_board {
 
 };
 
-
 /************************************************************************
  * Unit flag definitions for un_flags.
  ************************************************************************/
@@ -277,7 +273,6 @@ struct un_t {
 	struct device *un_sysfs;
 };
 
-
 /************************************************************************
  * Device flag definitions for ch_flags.
  ************************************************************************/
@@ -300,7 +295,6 @@ struct un_t {
 #define CH_FORCED_STOP  0x20000		/* Output is forcibly stopped	*/
 #define CH_FORCED_STOPI 0x40000		/* Input is forcibly stopped	*/
 
-
 /* Our Read/Error/Write queue sizes */
 #define RQUEUEMASK	0x1FFF		/* 8 K - 1 */
 #define EQUEUEMASK	0x1FFF		/* 8 K - 1 */
@@ -309,7 +303,6 @@ struct un_t {
 #define EQUEUESIZE	RQUEUESIZE
 #define WQUEUESIZE	(WQUEUEMASK + 1)
 
-
 /************************************************************************
  * Channel information structure.
  ************************************************************************/
@@ -397,7 +390,6 @@ struct channel_t {
 	ulong		ch_intr_tx;	/* Count of interrupts */
 	ulong		ch_intr_rx;	/* Count of interrupts */
 
-
 	/* /proc/<board>/<channel> entries */
 	struct proc_dir_entry *proc_entry_pointer;
 	struct dgnc_proc_entry *dgnc_channel_table;
drivers/staging/dgnc/dgnc_neo.c +152 -83

561 lines not on this page · raw message

drivers/staging/dgnc/dgnc_neo.h +14 -8
index c528df5..5be232f 100644
@@ -30,7 +30,8 @@
 struct neo_uart_struct {
 	u8 txrx;		/* WR  RHR/THR - Holding Reg */
 	u8 ier;		/* WR  IER - Interrupt Enable Reg */
-	u8 isr_fcr;		/* WR  ISR/FCR - Interrupt Status Reg/Fifo Control Reg */
+	u8 isr_fcr;
+	/* WR  ISR/FCR - Interrupt Status Reg/Fifo Control Reg */
 	u8 lcr;		/* WR  LCR - Line Control Reg */
 	u8 mcr;		/* WR  MCR - Modem Control Reg */
 	u8 lsr;		/* WR  LSR - Line Status Reg */
@@ -65,8 +66,8 @@ struct neo_uart_struct {
 #define NEO_EEDO  0x80		/* Data Out is an Input Pin */
 #define NEO_EEREG 0x8E		/* offset to EEPROM control reg */
 
-
-#define NEO_VPD_IMAGESIZE 0x40	/* size of image to read from EEPROM in words */
+#define NEO_VPD_IMAGESIZE 0x40
+/* size of image to read from EEPROM in words */
 #define NEO_VPD_IMAGEBYTES (NEO_VPD_IMAGESIZE * 2)
 
 /*
@@ -109,7 +110,8 @@ struct neo_uart_struct {
 /* 17158 Extended IIR's */
 #define UART_17158_IIR_RDI_TIMEOUT	0x0C	/* Receiver data TIMEOUT */
 #define UART_17158_IIR_XONXOFF		0x10	/* Received an XON/XOFF char */
-#define UART_17158_IIR_HWFLOW_STATE_CHANGE 0x20	/* CTS/DSR or RTS/DTR state change */
+#define UART_17158_IIR_HWFLOW_STATE_CHANGE 0x20
+/* CTS/DSR or RTS/DTR state change */
 #define UART_17158_IIR_FIFO_ENABLED	0xC0	/* 16550 FIFOs are Enabled */
 
 /*
@@ -120,8 +122,10 @@ struct neo_uart_struct {
 #define UART_17158_RXRDY_TIMEOUT	0x2	/* RX Ready Timeout */
 #define UART_17158_TXRDY		0x3	/* TX Ready */
 #define UART_17158_MSR			0x4	/* Modem State Change */
-#define UART_17158_TX_AND_FIFO_CLR	0x40	/* Transmitter Holding Reg Empty */
-#define UART_17158_RX_FIFO_DATA_ERROR	0x80	/* UART detected an RX FIFO Data error */
+#define UART_17158_TX_AND_FIFO_CLR	0x40
+/* Transmitter Holding Reg Empty */
+#define UART_17158_RX_FIFO_DATA_ERROR	0x80
+/* UART detected an RX FIFO Data error */
 
 /*
  * These are the EXTENDED definitions for the 17C158's Interrupt
@@ -133,8 +137,10 @@ struct neo_uart_struct {
 #define UART_17158_EFR_RTSDTR	0x40	/* Auto RTS/DTR Flow Control Enable */
 #define UART_17158_EFR_CTSDSR	0x80	/* Auto CTS/DSR Flow COntrol Enable */
 
-#define UART_17158_XOFF_DETECT	0x1	/* Indicates whether chip saw an incoming XOFF char  */
-#define UART_17158_XON_DETECT	0x2	/* Indicates whether chip saw an incoming XON char */
+#define UART_17158_XOFF_DETECT	0x1
+/* Indicates whether chip saw an incoming XOFF char  */
+#define UART_17158_XON_DETECT	0x2
+/* Indicates whether chip saw an incoming XON char */
 
 #define UART_17158_IER_RSVD1	0x10	/* Reserved by Exar */
 #define UART_17158_IER_XOFF	0x20	/* Xoff Interrupt Enable */
drivers/staging/dgnc/dgnc_pci.h +0 -1
index 617d40d..4e170c4 100644
@@ -59,7 +59,6 @@
 #define PCI_DEVICE_NEO_EXPRESS_8RJ45_PCI_NAME	"Neo 8 PCI Express RJ45"
 #define PCI_DEVICE_NEO_EXPRESS_4_IBM_PCI_NAME	"Neo 4 PCI Express IBM"
 
-
 /* Size of Memory and I/O for PCI (4 K) */
 #define PCI_RAM_SIZE				0x1000
 
drivers/staging/dgnc/dgnc_sysfs.c +12 -6
index 74a0725..db7951f 100644
@@ -193,12 +193,18 @@ static ssize_t dgnc_ports_msignals_show(struct device *p,
 			count += snprintf(buf + count, PAGE_SIZE - count,
 				"%d %s %s %s %s %s %s\n",
 				bd->channels[i]->ch_portnum,
-				(bd->channels[i]->ch_mostat & UART_MCR_RTS) ? "RTS" : "",
-				(bd->channels[i]->ch_mistat & UART_MSR_CTS) ? "CTS" : "",
-				(bd->channels[i]->ch_mostat & UART_MCR_DTR) ? "DTR" : "",
-				(bd->channels[i]->ch_mistat & UART_MSR_DSR) ? "DSR" : "",
-				(bd->channels[i]->ch_mistat & UART_MSR_DCD) ? "DCD" : "",
-				(bd->channels[i]->ch_mistat & UART_MSR_RI)  ? "RI"  : "");
+				(bd->channels[i]->ch_mostat & UART_MCR_RTS)
+				 ? "RTS" : "",
+				(bd->channels[i]->ch_mistat & UART_MSR_CTS)
+				 ? "CTS" : "",
+				(bd->channels[i]->ch_mostat & UART_MCR_DTR)
+				 ? "DTR" : "",
+				(bd->channels[i]->ch_mistat & UART_MSR_DSR)
+				 ? "DSR" : "",
+				(bd->channels[i]->ch_mistat & UART_MSR_DCD)
+				 ? "DCD" : "",
+				(bd->channels[i]->ch_mistat & UART_MSR_RI)
+				  ? "RI"  : "");
 		} else {
 			count += snprintf(buf + count, PAGE_SIZE - count,
 				"%d\n", bd->channels[i]->ch_portnum);
drivers/staging/dgnc/dgnc_tty.c +27 -19

111 lines not on this page · raw message

drivers/staging/dgnc/digi.h +16 -16
index cf9dcae..e202aac 100644
@@ -31,21 +31,21 @@
 #endif
 
 #if !defined(TIOCMSET)
-#define	TIOCMSET	(('d'<<8) | 252)	/* set modem ctrl state	*/
-#define	TIOCMGET	(('d'<<8) | 253)	/* set modem ctrl state	*/
+#define	TIOCMSET	(('d' << 8) | 252)	/* set modem ctrl state	*/
+#define	TIOCMGET	(('d' << 8) | 253)	/* set modem ctrl state	*/
 #endif
 
 #if !defined(TIOCMBIC)
-#define	TIOCMBIC	(('d'<<8) | 254)	/* set modem ctrl state */
-#define	TIOCMBIS	(('d'<<8) | 255)	/* set modem ctrl state */
+#define	TIOCMBIC	(('d' << 8) | 254)	/* set modem ctrl state */
+#define	TIOCMBIS	(('d' << 8) | 255)	/* set modem ctrl state */
 #endif
 
-#define DIGI_GETA	(('e'<<8) | 94)		/* Read params		*/
-#define DIGI_SETA	(('e'<<8) | 95)		/* Set params		*/
-#define DIGI_SETAW	(('e'<<8) | 96)		/* Drain & set params	*/
-#define DIGI_SETAF	(('e'<<8) | 97)		/* Drain, flush & set params */
-#define DIGI_GET_NI_INFO (('d'<<8) | 250) /* Non-intelligent state info */
-#define DIGI_LOOPBACK (('d'<<8) | 252) /*
+#define DIGI_GETA	(('e' << 8) | 94)	/* Read params*/
+#define DIGI_SETA	(('e' << 8) | 95)	/* Set params*/
+#define DIGI_SETAW	(('e' << 8) | 96)	/* Drain & set params*/
+#define DIGI_SETAF	(('e' << 8) | 97)	/* Drain, flush & set params*/
+#define DIGI_GET_NI_INFO (('d' << 8) | 250) /* Non-intelligent state info */
+#define DIGI_LOOPBACK (('d' << 8) | 252) /*
 					* Enable/disable UART
 					* internal loopback
 					*/
@@ -85,7 +85,7 @@ struct digi_dinfo {
 	char		dinfo_version[16];	/* driver version       */
 };
 
-#define	DIGI_GETDD	(('d'<<8) | 248)	/* get driver info      */
+#define	DIGI_GETDD	(('d' << 8) | 248)	/* get driver info      */
 
 /************************************************************************
  * Structure used with ioctl commands for per-board information
@@ -105,7 +105,7 @@ struct digi_info {
 	char		info_reserved[7];	/* for future expansion    */
 };
 
-#define	DIGI_GETBD	(('d'<<8) | 249)	/* get board info          */
+#define	DIGI_GETBD	(('d' << 8) | 249)	/* get board info          */
 
 struct digi_getbuffer /* Struct for holding buffer use counts */
 {
@@ -133,10 +133,10 @@ struct digi_getcounter {
 #define DIGI_SETCUSTOMBAUD _IOW('e', 106, int)	/* Set integer baud rate */
 #define DIGI_GETCUSTOMBAUD _IOR('e', 107, int)	/* Get integer baud rate */
 
-#define DIGI_REALPORT_GETBUFFERS (('e'<<8) | 108)
-#define DIGI_REALPORT_SENDIMMEDIATE (('e'<<8) | 109)
-#define DIGI_REALPORT_GETCOUNTERS (('e'<<8) | 110)
-#define DIGI_REALPORT_GETEVENTS (('e'<<8) | 111)
+#define DIGI_REALPORT_GETBUFFERS (('e' << 8) | 108)
+#define DIGI_REALPORT_SENDIMMEDIATE (('e' << 8) | 109)
+#define DIGI_REALPORT_GETCOUNTERS (('e' << 8) | 110)
+#define DIGI_REALPORT_GETEVENTS (('e' << 8) | 111)
 
 #define EV_OPU 0x0001 /* !<Output paused by client */
 #define EV_OPS 0x0002 /* !<Output paused by reqular sw flowctrl */
Signature · 1 line
2.5.0
#26 lore raw

Re: [PATCH FIXED 2/3] staging: dgnc: Patch for CamelCase fixes

In reply to Greg KH

Patch contains the CamelCase fixes & Macro fixes that checkpatch prompted for, as asked by the TODO.

---
 drivers/staging/dgnc/dgnc_driver.c |  56 ++++-----
 drivers/staging/dgnc/dgnc_driver.h |  25 ++--
 drivers/staging/dgnc/dgnc_mgmt.c   |  28 ++---
 drivers/staging/dgnc/dgnc_neo.c    | 226 +++++++++++++++++--------------------
 drivers/staging/dgnc/dgnc_sysfs.c  | 134 +++++++++++++++++-----
 drivers/staging/dgnc/dgnc_tty.c    | 197 ++++++++++++++++----------------
 drivers/staging/dgnc/digi.h        |  20 ++--
 7 files changed, 367 insertions(+), 319 deletions(-)
drivers/staging/dgnc/dgnc_driver.c +28 -28
index fc6d298..37fb8f9 100644
@@ -48,7 +48,7 @@ static void		dgnc_do_remap(struct dgnc_board *brd);
 /*
  * File operations permitted on Control/Management major.
  */
-static const struct file_operations dgnc_BoardFops = {
+static const struct file_operations dgnc_board_fops = {
 	.owner		=	THIS_MODULE,
 	.unlocked_ioctl =	dgnc_mgmt_ioctl,
 	.open		=	dgnc_mgmt_open,
@@ -58,11 +58,11 @@ static const struct file_operations dgnc_BoardFops = {
 /*
  * Globals
  */
-uint			dgnc_NumBoards;
-struct dgnc_board		*dgnc_Board[MAXBOARDS];
+uint			dgnc_num_boards;
+struct dgnc_board		*dgnc_board[MAXBOARDS];
 DEFINE_SPINLOCK(dgnc_global_lock);
 DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
-uint			dgnc_Major;
+uint			dgnc_major;
 int			dgnc_poll_tick = 20;	/* Poll interval - 20 ms */
 
 /*
@@ -92,7 +92,7 @@ struct board_id {
 	unsigned int is_pci_express;
 };
 
-static struct board_id dgnc_Ids[] = {
+static struct board_id dgnc_ids[] = {
 	{	PCI_DEVICE_CLASSIC_4_PCI_NAME,		4,	0	},
 	{	PCI_DEVICE_CLASSIC_4_422_PCI_NAME,	4,	0	},
 	{	PCI_DEVICE_CLASSIC_8_PCI_NAME,		8,	0	},
@@ -144,19 +144,19 @@ static void dgnc_cleanup_module(void)
 
 	dgnc_remove_driver_sysfiles(&dgnc_driver);
 
-	device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+	device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
 	class_destroy(dgnc_class);
-	unregister_chrdev(dgnc_Major, "dgnc");
+	unregister_chrdev(dgnc_major, "dgnc");
 
-	for (i = 0; i < dgnc_NumBoards; ++i) {
-		dgnc_remove_ports_sysfiles(dgnc_Board[i]);
-		dgnc_tty_uninit(dgnc_Board[i]);
-		dgnc_cleanup_board(dgnc_Board[i]);
+	for (i = 0; i < dgnc_num_boards; ++i) {
+		dgnc_remove_ports_sysfiles(dgnc_board[i]);
+		dgnc_tty_uninit(dgnc_board[i]);
+		dgnc_cleanup_board(dgnc_board[i]);
 	}
 
 	dgnc_tty_post_uninit();
 
-	if (dgnc_NumBoards)
+	if (dgnc_num_boards)
 		pci_unregister_driver(&dgnc_driver);
 }
 
@@ -187,7 +187,7 @@ static int __init dgnc_init_module(void)
 	 */
 	if (rc < 0) {
 		/* Only unregister if it was actually registered. */
-		if (dgnc_NumBoards)
+		if (dgnc_num_boards)
 			pci_unregister_driver(&dgnc_driver);
 		else
 			pr_warn("WARNING: dgnc driver load failed.  No Digi Neo or Classic boards found.\n");
@@ -222,12 +222,12 @@ static int dgnc_start(void)
 	 *
 	 * Register management/dpa devices
 	 */
-	rc = register_chrdev(0, "dgnc", &dgnc_BoardFops);
+	rc = register_chrdev(0, "dgnc", &dgnc_board_fops);
 	if (rc < 0) {
 		pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc);
 		return rc;
 	}
-	dgnc_Major = rc;
+	dgnc_major = rc;
 
 	dgnc_class = class_create(THIS_MODULE, "dgnc_mgmt");
 	if (IS_ERR(dgnc_class)) {
@@ -237,7 +237,7 @@ static int dgnc_start(void)
 	}
 
 	dev = device_create(dgnc_class, NULL,
-			    MKDEV(dgnc_Major, 0),
+			    MKDEV(dgnc_major, 0),
 			NULL, "dgnc_mgmt");
 	if (IS_ERR(dev)) {
 		rc = PTR_ERR(dev);
@@ -267,11 +267,11 @@ static int dgnc_start(void)
 	return 0;
 
 failed_tty:
-	device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+	device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
 failed_device:
 	class_destroy(dgnc_class);
 failed_class:
-	unregister_chrdev(dgnc_Major, "dgnc");
+	unregister_chrdev(dgnc_major, "dgnc");
 	return rc;
 }
 
@@ -288,7 +288,7 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	} else {
 		rc = dgnc_found_board(pdev, ent->driver_data);
 		if (rc == 0)
-			dgnc_NumBoards++;
+			dgnc_num_boards++;
 	}
 	return rc;
 }
@@ -351,7 +351,7 @@ static void dgnc_cleanup_board(struct dgnc_board *brd)
 		}
 	}
 
-	dgnc_Board[brd->boardnum] = NULL;
+	dgnc_board[brd->boardnum] = NULL;
 
 	kfree(brd);
 }
@@ -370,8 +370,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 	unsigned long flags;
 
 	/* get the board structure and prep it */
-	dgnc_Board[dgnc_NumBoards] = kzalloc(sizeof(*brd), GFP_KERNEL);
-	brd = dgnc_Board[dgnc_NumBoards];
+	dgnc_board[dgnc_num_boards] = kzalloc(sizeof(*brd), GFP_KERNEL);
+	brd = dgnc_board[dgnc_num_boards];
 
 	if (!brd)
 		return -ENOMEM;
@@ -387,15 +387,15 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 
 	/* store the info for the board we've found */
 	brd->magic = DGNC_BOARD_MAGIC;
-	brd->boardnum = dgnc_NumBoards;
+	brd->boardnum = dgnc_num_boards;
 	brd->vendor = dgnc_pci_tbl[id].vendor;
 	brd->device = dgnc_pci_tbl[id].device;
 	brd->pdev = pdev;
 	brd->pci_bus = pdev->bus->number;
 	brd->pci_slot = PCI_SLOT(pdev->devfn);
-	brd->name = dgnc_Ids[id].name;
-	brd->maxports = dgnc_Ids[id].maxports;
-	if (dgnc_Ids[i].is_pci_express)
+	brd->name = dgnc_ids[id].name;
+	brd->maxports = dgnc_ids[id].maxports;
+	if (dgnc_ids[i].is_pci_express)
 		brd->bd_flags |= BD_IS_PCI_EXPRESS;
 	brd->dpastatus = BD_NOFEP;
 	init_waitqueue_head(&brd->state_wait);
@@ -647,8 +647,8 @@ static void dgnc_poll_handler(ulong dummy)
 	unsigned long new_time;
 
 	/* Go thru each board, kicking off a tasklet for each if needed */
-	for (i = 0; i < dgnc_NumBoards; i++) {
-		brd = dgnc_Board[i];
+	for (i = 0; i < dgnc_num_boards; i++) {
+		brd = dgnc_board[i];
 
 		spin_lock_irqsave(&brd->bd_lock, flags);
 
drivers/staging/dgnc/dgnc_driver.h +13 -12
index e4be81b..7bed033 100644
@@ -24,6 +24,7 @@
 #include <linux/types.h>
 #include <linux/tty.h>
 #include <linux/interrupt.h>
+#include <linux/spinlock_types.h>
 
 #include "digi.h"		/* Digi specific ioctl header */
 #include "dgnc_sysfs.h"		/* Support for SYSFS */
@@ -202,18 +203,18 @@ struct dgnc_board {
 						 * to our channels.
 						 */
 
-	struct tty_driver	SerialDriver;
-	char		SerialName[200];
-	struct tty_driver	PrintDriver;
-	char		PrintName[200];
+	struct tty_driver	serial_driver;
+	char		serial_name[200];
+	struct tty_driver	print_driver;
+	char		print_name[200];
 
-	bool		dgnc_Major_Serial_Registered;
-	bool		dgnc_Major_TransparentPrint_Registered;
+	bool		dgnc_major_serial_registered;
+	bool		dgnc_major_transparent_print_registered;
 
-	uint		dgnc_Serial_Major;
-	uint		dgnc_TransparentPrint_Major;
+	uint		dgnc_serial_major;
+	uint		dgnc_transparent_print_major;
 
-	uint		TtyRefCnt;
+	uint		tty_ref_cnt;
 
 	u16		dpatype;	/* The board "type",
 					 * as defined by DPA
@@ -399,12 +400,12 @@ struct channel_t {
 /*
  * Our Global Variables.
  */
-extern uint		dgnc_Major;		/* Our driver/mgmt major */
+extern uint		dgnc_major;		/* Our driver/mgmt major */
 extern int		dgnc_poll_tick;		/* Poll interval - 20 ms */
 extern spinlock_t	dgnc_global_lock;	/* Driver global spinlock */
 extern spinlock_t	dgnc_poll_lock;		/* Poll scheduling lock */
-extern uint		dgnc_NumBoards;		/* Total number of boards */
-extern struct dgnc_board	*dgnc_Board[MAXBOARDS];	/* Array of board
+extern uint		dgnc_num_boards;	/* Total number of boards */
+extern struct dgnc_board	*dgnc_board[MAXBOARDS];	/* Array of board
 							 * structs
 							 */
 
drivers/staging/dgnc/dgnc_mgmt.c +14 -14
index 518fbd5..35a9295 100644
@@ -111,7 +111,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		spin_lock_irqsave(&dgnc_global_lock, flags);
 
 		memset(&ddi, 0, sizeof(ddi));
-		ddi.dinfo_nboards = dgnc_NumBoards;
+		ddi.dinfo_nboards = dgnc_num_boards;
 		sprintf(ddi.dinfo_version, "%s", DG_PART);
 
 		spin_unlock_irqrestore(&dgnc_global_lock, flags);
@@ -131,27 +131,27 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		if (copy_from_user(&brd, uarg, sizeof(int)))
 			return -EFAULT;
 
-		if (brd < 0 || brd >= dgnc_NumBoards)
+		if (brd < 0 || brd >= dgnc_num_boards)
 			return -ENODEV;
 
 		memset(&di, 0, sizeof(di));
 
 		di.info_bdnum = brd;
 
-		spin_lock_irqsave(&dgnc_Board[brd]->bd_lock, flags);
+		spin_lock_irqsave(&dgnc_board[brd]->bd_lock, flags);
 
-		di.info_bdtype = dgnc_Board[brd]->dpatype;
-		di.info_bdstate = dgnc_Board[brd]->dpastatus;
+		di.info_bdtype = dgnc_board[brd]->dpatype;
+		di.info_bdstate = dgnc_board[brd]->dpastatus;
 		di.info_ioport = 0;
-		di.info_physaddr = (ulong)dgnc_Board[brd]->membase;
-		di.info_physsize = (ulong)dgnc_Board[brd]->membase
-			- dgnc_Board[brd]->membase_end;
-		if (dgnc_Board[brd]->state != BOARD_FAILED)
-			di.info_nports = dgnc_Board[brd]->nasync;
+		di.info_physaddr = (ulong)dgnc_board[brd]->membase;
+		di.info_physsize = (ulong)dgnc_board[brd]->membase
+			- dgnc_board[brd]->membase_end;
+		if (dgnc_board[brd]->state != BOARD_FAILED)
+			di.info_nports = dgnc_board[brd]->nasync;
 		else
 			di.info_nports = 0;
 
-		spin_unlock_irqrestore(&dgnc_Board[brd]->bd_lock, flags);
+		spin_unlock_irqrestore(&dgnc_board[brd]->bd_lock, flags);
 
 		if (copy_to_user(uarg, &di, sizeof(di)))
 			return -EFAULT;
@@ -174,14 +174,14 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		channel = ni.channel;
 
 		/* Verify boundaries on board */
-		if (board >= dgnc_NumBoards)
+		if (board >= dgnc_num_boards)
 			return -ENODEV;
 
 		/* Verify boundaries on channel */
-		if (channel >= dgnc_Board[board]->nasync)
+		if (channel >= dgnc_board[board]->nasync)
 			return -ENODEV;
 
-		ch = dgnc_Board[board]->channels[channel];
+		ch = dgnc_board[board]->channels[channel];
 
 		if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
 			return -ENODEV;
drivers/staging/dgnc/dgnc_neo.c +103 -123

519 lines not on this page · raw message

drivers/staging/dgnc/dgnc_sysfs.c +103 -31

229 lines not on this page · raw message

drivers/staging/dgnc/dgnc_tty.c +96 -101

390 lines not on this page · raw message

drivers/staging/dgnc/digi.h +10 -10
index e202aac..701312f 100644
@@ -40,10 +40,10 @@
 #define	TIOCMBIS	(('d' << 8) | 255)	/* set modem ctrl state */
 #endif
 
-#define DIGI_GETA	(('e' << 8) | 94)	/* Read params*/
-#define DIGI_SETA	(('e' << 8) | 95)	/* Set params*/
-#define DIGI_SETAW	(('e' << 8) | 96)	/* Drain & set params*/
-#define DIGI_SETAF	(('e' << 8) | 97)	/* Drain, flush & set params*/
+#define DIGI_GETA	(('e' << 8) | 94)	/* Read params		*/
+#define DIGI_SETA	(('e' << 8) | 95)	/* Set params		*/
+#define DIGI_SETAW	(('e' << 8) | 96)	/* Drain & set params	*/
+#define DIGI_SETAF	(('e' << 8) | 97)	/* Drain, flush & set params */
 #define DIGI_GET_NI_INFO (('d' << 8) | 250) /* Non-intelligent state info */
 #define DIGI_LOOPBACK (('d' << 8) | 252) /*
 					* Enable/disable UART
@@ -94,10 +94,10 @@ struct digi_dinfo {
  ************************************************************************/
 struct digi_info {
 	unsigned int	info_bdnum;		/* Board number (0 based)  */
-	unsigned int	info_ioport;		/* io port address         */
-	unsigned int	info_physaddr;		/* memory address          */
-	unsigned int	info_physsize;		/* Size of host mem window */
-	unsigned int	info_memsize;		/* Amount of dual-port mem */
+	unsigned int	info_ioport;	/* io port address         */
+	unsigned int	info_physaddr;	/* memory address          */
+	unsigned int	info_physsize;	/* Size of host mem window */
+	unsigned int	info_memsize;	/* Amount of dual-port mem */
 						/* on board                */
 	unsigned short	info_bdtype;		/* Board type              */
 	unsigned short	info_nports;		/* number of ports         */
@@ -109,8 +109,8 @@ struct digi_info {
 
 struct digi_getbuffer /* Struct for holding buffer use counts */
 {
-	unsigned long tIn;
-	unsigned long tOut;
+	unsigned long t_in;
+	unsigned long t_out;
 	unsigned long rxbuf;
 	unsigned long txbuf;
 	unsigned long txdone;
Signature · 1 line
2.5.0
#27 lore raw

Re: [PATCH FIXED 3/3] staging: dgnc: Patch updates the TODO file

In reply to Greg KH

Patch updates the TODO file.

---
 drivers/staging/dgnc/TODO | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/dgnc/TODO +0 -1
index 0e0825b..0bdfd26 100644
@@ -1,4 +1,3 @@
-* checkpatch fixes
 * remove unnecessary comments
 * remove unnecessary error messages. Example kzalloc() has its
   own error message. Adding an extra one is useless.
Signature · 1 line
2.5.0
#20 lore raw

Re: [PATCH FIXED 1/3] staging: dgnc: Patch includes spacing fixes

Patch contains the spacing fixes that led to checkpatch.pl warnings.

---
 drivers/staging/dgnc/dgnc_cls.c    |   4 +-
 drivers/staging/dgnc/dgnc_driver.h |   8 --
 drivers/staging/dgnc/dgnc_neo.c    | 235 ++++++++++++++++++++++++-------------
 drivers/staging/dgnc/dgnc_neo.h    |  22 ++--
 drivers/staging/dgnc/dgnc_pci.h    |   1 -
 drivers/staging/dgnc/dgnc_sysfs.c  |  18 ++-
 drivers/staging/dgnc/dgnc_tty.c    |  46 +++++---
 drivers/staging/dgnc/digi.h        |  32 ++---
 8 files changed, 223 insertions(+), 143 deletions(-)
drivers/staging/dgnc/dgnc_cls.c +2 -2
index 75040da..d312d35 100644
@@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch)
 	/* Clear out UART and FIFO */
 	readb(&ch->ch_cls_uart->txrx);
 
-	writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
-	       &ch->ch_cls_uart->isr_fcr);
+	writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
+		   UART_FCR_CLEAR_XMIT), &ch->ch_cls_uart->isr_fcr);
 	udelay(10);
 
 	ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
drivers/staging/dgnc/dgnc_driver.h +0 -8
index ce7cd9b..e4be81b 100644
@@ -88,7 +88,6 @@
 #define   _POSIX_VDISABLE '\0'
 #endif
 
-
 /*
  * All the possible states the driver can be while being loaded.
  */
@@ -106,7 +105,6 @@ enum {
 	BOARD_READY
 };
 
-
 /*************************************************************************
  *
  * Structures and closely related defines.
@@ -145,7 +143,6 @@ struct board_ops {
  ************************************************************************/
 #define BD_IS_PCI_EXPRESS     0x0001	  /* Is a PCI Express board */
 
-
 /*
  *	Per-board information
  */
@@ -241,7 +238,6 @@ struct dgnc_board {
 
 };
 
-
 /************************************************************************
  * Unit flag definitions for un_flags.
  ************************************************************************/
@@ -277,7 +273,6 @@ struct un_t {
 	struct device *un_sysfs;
 };
 
-
 /************************************************************************
  * Device flag definitions for ch_flags.
  ************************************************************************/
@@ -300,7 +295,6 @@ struct un_t {
 #define CH_FORCED_STOP  0x20000		/* Output is forcibly stopped	*/
 #define CH_FORCED_STOPI 0x40000		/* Input is forcibly stopped	*/
 
-
 /* Our Read/Error/Write queue sizes */
 #define RQUEUEMASK	0x1FFF		/* 8 K - 1 */
 #define EQUEUEMASK	0x1FFF		/* 8 K - 1 */
@@ -309,7 +303,6 @@ struct un_t {
 #define EQUEUESIZE	RQUEUESIZE
 #define WQUEUESIZE	(WQUEUEMASK + 1)
 
-
 /************************************************************************
  * Channel information structure.
  ************************************************************************/
@@ -397,7 +390,6 @@ struct channel_t {
 	ulong		ch_intr_tx;	/* Count of interrupts */
 	ulong		ch_intr_rx;	/* Count of interrupts */
 
-
 	/* /proc/<board>/<channel> entries */
 	struct proc_dir_entry *proc_entry_pointer;
 	struct dgnc_proc_entry *dgnc_channel_table;
drivers/staging/dgnc/dgnc_neo.c +152 -83

561 lines not on this page · raw message

drivers/staging/dgnc/dgnc_neo.h +14 -8
index c528df5..5be232f 100644
@@ -30,7 +30,8 @@
 struct neo_uart_struct {
 	u8 txrx;		/* WR  RHR/THR - Holding Reg */
 	u8 ier;		/* WR  IER - Interrupt Enable Reg */
-	u8 isr_fcr;		/* WR  ISR/FCR - Interrupt Status Reg/Fifo Control Reg */
+	u8 isr_fcr;
+	/* WR  ISR/FCR - Interrupt Status Reg/Fifo Control Reg */
 	u8 lcr;		/* WR  LCR - Line Control Reg */
 	u8 mcr;		/* WR  MCR - Modem Control Reg */
 	u8 lsr;		/* WR  LSR - Line Status Reg */
@@ -65,8 +66,8 @@ struct neo_uart_struct {
 #define NEO_EEDO  0x80		/* Data Out is an Input Pin */
 #define NEO_EEREG 0x8E		/* offset to EEPROM control reg */
 
-
-#define NEO_VPD_IMAGESIZE 0x40	/* size of image to read from EEPROM in words */
+#define NEO_VPD_IMAGESIZE 0x40
+/* size of image to read from EEPROM in words */
 #define NEO_VPD_IMAGEBYTES (NEO_VPD_IMAGESIZE * 2)
 
 /*
@@ -109,7 +110,8 @@ struct neo_uart_struct {
 /* 17158 Extended IIR's */
 #define UART_17158_IIR_RDI_TIMEOUT	0x0C	/* Receiver data TIMEOUT */
 #define UART_17158_IIR_XONXOFF		0x10	/* Received an XON/XOFF char */
-#define UART_17158_IIR_HWFLOW_STATE_CHANGE 0x20	/* CTS/DSR or RTS/DTR state change */
+#define UART_17158_IIR_HWFLOW_STATE_CHANGE 0x20
+/* CTS/DSR or RTS/DTR state change */
 #define UART_17158_IIR_FIFO_ENABLED	0xC0	/* 16550 FIFOs are Enabled */
 
 /*
@@ -120,8 +122,10 @@ struct neo_uart_struct {
 #define UART_17158_RXRDY_TIMEOUT	0x2	/* RX Ready Timeout */
 #define UART_17158_TXRDY		0x3	/* TX Ready */
 #define UART_17158_MSR			0x4	/* Modem State Change */
-#define UART_17158_TX_AND_FIFO_CLR	0x40	/* Transmitter Holding Reg Empty */
-#define UART_17158_RX_FIFO_DATA_ERROR	0x80	/* UART detected an RX FIFO Data error */
+#define UART_17158_TX_AND_FIFO_CLR	0x40
+/* Transmitter Holding Reg Empty */
+#define UART_17158_RX_FIFO_DATA_ERROR	0x80
+/* UART detected an RX FIFO Data error */
 
 /*
  * These are the EXTENDED definitions for the 17C158's Interrupt
@@ -133,8 +137,10 @@ struct neo_uart_struct {
 #define UART_17158_EFR_RTSDTR	0x40	/* Auto RTS/DTR Flow Control Enable */
 #define UART_17158_EFR_CTSDSR	0x80	/* Auto CTS/DSR Flow COntrol Enable */
 
-#define UART_17158_XOFF_DETECT	0x1	/* Indicates whether chip saw an incoming XOFF char  */
-#define UART_17158_XON_DETECT	0x2	/* Indicates whether chip saw an incoming XON char */
+#define UART_17158_XOFF_DETECT	0x1
+/* Indicates whether chip saw an incoming XOFF char  */
+#define UART_17158_XON_DETECT	0x2
+/* Indicates whether chip saw an incoming XON char */
 
 #define UART_17158_IER_RSVD1	0x10	/* Reserved by Exar */
 #define UART_17158_IER_XOFF	0x20	/* Xoff Interrupt Enable */
drivers/staging/dgnc/dgnc_pci.h +0 -1
index 617d40d..4e170c4 100644
@@ -59,7 +59,6 @@
 #define PCI_DEVICE_NEO_EXPRESS_8RJ45_PCI_NAME	"Neo 8 PCI Express RJ45"
 #define PCI_DEVICE_NEO_EXPRESS_4_IBM_PCI_NAME	"Neo 4 PCI Express IBM"
 
-
 /* Size of Memory and I/O for PCI (4 K) */
 #define PCI_RAM_SIZE				0x1000
 
drivers/staging/dgnc/dgnc_sysfs.c +12 -6
index 74a0725..db7951f 100644
@@ -193,12 +193,18 @@ static ssize_t dgnc_ports_msignals_show(struct device *p,
 			count += snprintf(buf + count, PAGE_SIZE - count,
 				"%d %s %s %s %s %s %s\n",
 				bd->channels[i]->ch_portnum,
-				(bd->channels[i]->ch_mostat & UART_MCR_RTS) ? "RTS" : "",
-				(bd->channels[i]->ch_mistat & UART_MSR_CTS) ? "CTS" : "",
-				(bd->channels[i]->ch_mostat & UART_MCR_DTR) ? "DTR" : "",
-				(bd->channels[i]->ch_mistat & UART_MSR_DSR) ? "DSR" : "",
-				(bd->channels[i]->ch_mistat & UART_MSR_DCD) ? "DCD" : "",
-				(bd->channels[i]->ch_mistat & UART_MSR_RI)  ? "RI"  : "");
+				(bd->channels[i]->ch_mostat & UART_MCR_RTS)
+				 ? "RTS" : "",
+				(bd->channels[i]->ch_mistat & UART_MSR_CTS)
+				 ? "CTS" : "",
+				(bd->channels[i]->ch_mostat & UART_MCR_DTR)
+				 ? "DTR" : "",
+				(bd->channels[i]->ch_mistat & UART_MSR_DSR)
+				 ? "DSR" : "",
+				(bd->channels[i]->ch_mistat & UART_MSR_DCD)
+				 ? "DCD" : "",
+				(bd->channels[i]->ch_mistat & UART_MSR_RI)
+				  ? "RI"  : "");
 		} else {
 			count += snprintf(buf + count, PAGE_SIZE - count,
 				"%d\n", bd->channels[i]->ch_portnum);
drivers/staging/dgnc/dgnc_tty.c +27 -19

111 lines not on this page · raw message

drivers/staging/dgnc/digi.h +16 -16
index cf9dcae..e202aac 100644
@@ -31,21 +31,21 @@
 #endif
 
 #if !defined(TIOCMSET)
-#define	TIOCMSET	(('d'<<8) | 252)	/* set modem ctrl state	*/
-#define	TIOCMGET	(('d'<<8) | 253)	/* set modem ctrl state	*/
+#define	TIOCMSET	(('d' << 8) | 252)	/* set modem ctrl state	*/
+#define	TIOCMGET	(('d' << 8) | 253)	/* set modem ctrl state	*/
 #endif
 
 #if !defined(TIOCMBIC)
-#define	TIOCMBIC	(('d'<<8) | 254)	/* set modem ctrl state */
-#define	TIOCMBIS	(('d'<<8) | 255)	/* set modem ctrl state */
+#define	TIOCMBIC	(('d' << 8) | 254)	/* set modem ctrl state */
+#define	TIOCMBIS	(('d' << 8) | 255)	/* set modem ctrl state */
 #endif
 
-#define DIGI_GETA	(('e'<<8) | 94)		/* Read params		*/
-#define DIGI_SETA	(('e'<<8) | 95)		/* Set params		*/
-#define DIGI_SETAW	(('e'<<8) | 96)		/* Drain & set params	*/
-#define DIGI_SETAF	(('e'<<8) | 97)		/* Drain, flush & set params */
-#define DIGI_GET_NI_INFO (('d'<<8) | 250) /* Non-intelligent state info */
-#define DIGI_LOOPBACK (('d'<<8) | 252) /*
+#define DIGI_GETA	(('e' << 8) | 94)	/* Read params*/
+#define DIGI_SETA	(('e' << 8) | 95)	/* Set params*/
+#define DIGI_SETAW	(('e' << 8) | 96)	/* Drain & set params*/
+#define DIGI_SETAF	(('e' << 8) | 97)	/* Drain, flush & set params*/
+#define DIGI_GET_NI_INFO (('d' << 8) | 250) /* Non-intelligent state info */
+#define DIGI_LOOPBACK (('d' << 8) | 252) /*
 					* Enable/disable UART
 					* internal loopback
 					*/
@@ -85,7 +85,7 @@ struct digi_dinfo {
 	char		dinfo_version[16];	/* driver version       */
 };
 
-#define	DIGI_GETDD	(('d'<<8) | 248)	/* get driver info      */
+#define	DIGI_GETDD	(('d' << 8) | 248)	/* get driver info      */
 
 /************************************************************************
  * Structure used with ioctl commands for per-board information
@@ -105,7 +105,7 @@ struct digi_info {
 	char		info_reserved[7];	/* for future expansion    */
 };
 
-#define	DIGI_GETBD	(('d'<<8) | 249)	/* get board info          */
+#define	DIGI_GETBD	(('d' << 8) | 249)	/* get board info          */
 
 struct digi_getbuffer /* Struct for holding buffer use counts */
 {
@@ -133,10 +133,10 @@ struct digi_getcounter {
 #define DIGI_SETCUSTOMBAUD _IOW('e', 106, int)	/* Set integer baud rate */
 #define DIGI_GETCUSTOMBAUD _IOR('e', 107, int)	/* Get integer baud rate */
 
-#define DIGI_REALPORT_GETBUFFERS (('e'<<8) | 108)
-#define DIGI_REALPORT_SENDIMMEDIATE (('e'<<8) | 109)
-#define DIGI_REALPORT_GETCOUNTERS (('e'<<8) | 110)
-#define DIGI_REALPORT_GETEVENTS (('e'<<8) | 111)
+#define DIGI_REALPORT_GETBUFFERS (('e' << 8) | 108)
+#define DIGI_REALPORT_SENDIMMEDIATE (('e' << 8) | 109)
+#define DIGI_REALPORT_GETCOUNTERS (('e' << 8) | 110)
+#define DIGI_REALPORT_GETEVENTS (('e' << 8) | 111)
 
 #define EV_OPU 0x0001 /* !<Output paused by client */
 #define EV_OPS 0x0002 /* !<Output paused by reqular sw flowctrl */
Signature · 1 line
2.5.0
#22 lore raw
In reply to Greg KH

Patch contains the spacing fixes that led to checkpatch.pl warnings.

---
 drivers/staging/dgnc/dgnc_cls.c    |   4 +-
 drivers/staging/dgnc/dgnc_driver.h |   8 --
 drivers/staging/dgnc/dgnc_neo.c    | 235
++++++++++++++++++++++++-------------
drivers/staging/dgnc/dgnc_neo.h    |  22 ++--
drivers/staging/dgnc/dgnc_pci.h    |   1 -
drivers/staging/dgnc/dgnc_sysfs.c  |  18 ++-
drivers/staging/dgnc/dgnc_tty.c    |  46 +++++---
drivers/staging/dgnc/digi.h        |  32 ++--- 8 files changed, 223

insertions(+), 143 deletions(-)

(quoted diff) +0 -0

b/drivers/staging/dgnc/dgnc_cls.c index 75040da..d312d35 100644

drivers/staging/dgnc/dgnc_cls.c +0 -1
@@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch)
 	/* Clear out UART and FIFO */
 	readb(&ch->ch_cls_uart->txrx);
 
-

writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
- &ch->ch_cls_uart->isr_fcr);
+ writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
+ UART_FCR_CLEAR_XMIT), &ch->ch_cls_uart->isr_fcr);
udelay(10);

ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY |
CH_TX_FIFO_LWM); diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index ce7cd9b..e4be81b 100644

drivers/staging/dgnc/dgnc_driver.h +0 -2
@@ -88,7 +88,6 @@
 #define   _POSIX_VDISABLE '\0'
 #endif
 
-
 /*
  * All the possible states the driver can be while being loaded.
  */
@@ -106,7 +105,6 @@ enum {
 	BOARD_READY
 };
 
-
 /*************************************************************************
  *
  * Structures and closely related defines.
@@ -145,7 +143,6 @@ struct board_ops {
  ************************************************************************/
 #define BD_IS_PCI_EXPRESS     0x0001	  /* Is a PCI Express

board */
-
/*
* Per-board information
*/
@@ -241,7 +238,6 @@ struct dgnc_board {

};

-
/************************************************************************
* Unit flag definitions for un_flags. ************************************************************************/
@@ -277,7 +273,6 @@ struct un_t {
struct device *un_sysfs;
};

-
/************************************************************************
* Device flag definitions for ch_flags. ************************************************************************/
@@ -300,7 +295,6 @@ struct un_t {
#define CH_FORCED_STOP 0x20000 /* Output is forcibly
stopped */ #define CH_FORCED_STOPI 0x40000 /*
Input is forcibly stopped */
-
/* Our Read/Error/Write queue sizes */
#define RQUEUEMASK 0x1FFF /* 8 K - 1 */
#define EQUEUEMASK 0x1FFF /* 8 K - 1 */
@@ -309,7 +303,6 @@ struct un_t {
#define EQUEUESIZE RQUEUESIZE
#define WQUEUESIZE (WQUEUEMASK + 1)

-
/************************************************************************
* Channel information structure. ************************************************************************/
@@ -397,7 +390,6 @@ struct channel_t {
ulong ch_intr_tx; /* Count of interrupts
*/ ulong ch_intr_rx; /* Count of interrupts */

-
/* /proc/<board>/<channel> entries */ struct proc_dir_entry *proc_entry_pointer; struct dgnc_proc_entry *dgnc_channel_table;

(quoted diff) +0 -0

b/drivers/staging/dgnc/dgnc_neo.c index 8106f52..2b94b75 100644

drivers/staging/dgnc/dgnc_neo.c +0 -1
@@ -77,7 +77,8 @@ struct board_ops dgnc_neo_ops = {
 	.send_immediate_char =		neo_send_immediate_char
 };
 
-static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08, 0x10,

0x20, 0x40, 0x80 }; +static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08,
+ 0x10, 0x20, 0x40, 0x80 };

/*
* This function allows calls to ensure that all outstanding
@@ -109,14 +110,17 @@ static inline void neo_set_cts_flow_control(struct channel_t *ch) /* Turn off auto Xon flow control */ efr &= ~UART_17158_EFR_IXON;

- /* Why? Becuz Exar's spec says we have to zero it out before
setting it */
+ /* Why? Becuz Exar's spec says we have to
+ * zero it out before setting it.
+ */
writeb(0, &ch->ch_neo_uart->efr);

/* Turn on UART enhanced bits */
writeb(efr, &ch->ch_neo_uart->efr);

/* Turn on table D, with 8 char hi/low watermarks */
- writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY),
&ch->ch_neo_uart->fctr);
+ writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY),
+ &ch->ch_neo_uart->fctr);

/* Feed the UART our trigger levels */ writeb(8, &ch->ch_neo_uart->tfifo);
@@ -144,13 +148,16 @@ static inline void neo_set_rts_flow_control(struct channel_t *ch) ier &= ~UART_17158_IER_XOFF; efr &= ~UART_17158_EFR_IXOFF;

- /* Why? Becuz Exar's spec says we have to zero it out before
setting it */
+ /* Why? Becuz Exar's spec says we have to
+ * zero it out before setting it.
+ */
writeb(0, &ch->ch_neo_uart->efr);

/* Turn on UART enhanced bits */
writeb(efr, &ch->ch_neo_uart->efr);

- writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY),
&ch->ch_neo_uart->fctr);
+ writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY),
+ &ch->ch_neo_uart->fctr);
ch->ch_r_watermark = 4;

writeb(32, &ch->ch_neo_uart->rfifo);
@@ -181,13 +188,16 @@ static inline void neo_set_ixon_flow_control(struct channel_t *ch) /* Turn on auto Xon flow control */ efr |= (UART_17158_EFR_ECB | UART_17158_EFR_IXON);

- /* Why? Becuz Exar's spec says we have to zero it out before
setting it */
+ /* Why? Becuz Exar's spec says we have to
+ * zero it out before setting it.
+ */
writeb(0, &ch->ch_neo_uart->efr);

/* Turn on UART enhanced bits */
writeb(efr, &ch->ch_neo_uart->efr);

- writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_8DELAY),
&ch->ch_neo_uart->fctr);
+ writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_8DELAY),
+ &ch->ch_neo_uart->fctr);
ch->ch_r_watermark = 4;

writeb(32, &ch->ch_neo_uart->rfifo);
@@ -218,14 +228,17 @@ static inline void neo_set_ixoff_flow_control(struct channel_t *ch) ier |= UART_17158_IER_XOFF; efr |= (UART_17158_EFR_ECB | UART_17158_EFR_IXOFF);

- /* Why? Becuz Exar's spec says we have to zero it out before
setting it */
+ /* Why? Becuz Exar's spec says we have to
+ * zero it out before setting it.
+ */
writeb(0, &ch->ch_neo_uart->efr);

/* Turn on UART enhanced bits */
writeb(efr, &ch->ch_neo_uart->efr);

/* Turn on table D, with 8 char hi/low watermarks */
- writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_8DELAY),
&ch->ch_neo_uart->fctr);
+ writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_8DELAY),
+ &ch->ch_neo_uart->fctr);

writeb(8, &ch->ch_neo_uart->tfifo); ch->ch_t_tlevel = 8;
@@ -258,14 +271,17 @@ static inline void neo_set_no_input_flow_control(struct channel_t *ch) else
efr &= ~(UART_17158_EFR_ECB | UART_17158_EFR_IXOFF);

- /* Why? Becuz Exar's spec says we have to zero it out before
setting it */
+ /* Why? Becuz Exar's spec says we have to
+ * zero it out before setting it.
+ */
writeb(0, &ch->ch_neo_uart->efr);

/* Turn on UART enhanced bits */
writeb(efr, &ch->ch_neo_uart->efr);

/* Turn on table D, with 8 char hi/low watermarks */
- writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_8DELAY),
&ch->ch_neo_uart->fctr);
+ writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_8DELAY),
+ &ch->ch_neo_uart->fctr);

ch->ch_r_watermark = 0;

@@ -295,14 +311,17 @@ static inline void neo_set_no_output_flow_control(struct channel_t *ch) else
efr &= ~(UART_17158_EFR_ECB | UART_17158_EFR_IXON);

- /* Why? Becuz Exar's spec says we have to zero it out before
setting it */
+ /* Why? Becuz Exar's spec says we have to
+ * zero it out before setting it.
+ */
writeb(0, &ch->ch_neo_uart->efr);

/* Turn on UART enhanced bits */
writeb(efr, &ch->ch_neo_uart->efr);

/* Turn on table D, with 8 char hi/low watermarks */
- writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_8DELAY),
&ch->ch_neo_uart->fctr);
+ writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_8DELAY),
+ &ch->ch_neo_uart->fctr);

ch->ch_r_watermark = 0;

@@ -321,7 +340,8 @@ static inline void neo_set_no_output_flow_control(struct channel_t *ch) static inline void neo_set_new_start_stop_chars(struct channel_t *ch) {
/* if hardware flow control is set, then skip this whole thing
*/
- if (ch->ch_digi.digi_flags & (CTSPACE | RTSPACE) ||
ch->ch_c_cflag & CRTSCTS)
+ if (ch->ch_digi.digi_flags & (CTSPACE | RTSPACE) ||
+ ch->ch_c_cflag & CRTSCTS)
return;

/* Tell UART what start/stop chars it should be looking for */
@@ -352,7 +372,7 @@ static inline void neo_clear_break(struct channel_t *ch, int force) /* Turn break off, and unset some variables */
if (ch->ch_flags & CH_BREAK_SENDING) {
if (time_after_eq(jiffies, ch->ch_stop_sending_break)
- || force) {
+ || force) {
unsigned char temp =
readb(&ch->ch_neo_uart->lcr);
writeb((temp & ~UART_LCR_SBC),
&ch->ch_neo_uart->lcr); @@ -393,7 +413,8 @@ static inline void neo_parse_isr(struct dgnc_board *brd, uint port) break;

/*
- * Yank off the upper 2 bits, which just show that the
FIFO's are enabled.
+ * Yank off the upper 2 bits, which just show
+ * that the FIFO's are enabled.
*/
isr &= ~(UART_17158_IIR_FIFO_ENABLED);

@@ -403,7 +424,9 @@ static inline void neo_parse_isr(struct dgnc_board *brd, uint port) ch->ch_intr_rx++;
neo_copy_data_from_uart_to_queue(ch);

- /* Call our tty layer to enforce queue flow
control if needed. */
+ /* Call our tty layer to enforce queue
+ * flow control if needed.
+ */
spin_lock_irqsave(&ch->ch_lock, flags); dgnc_check_queue_flow_control(ch); spin_unlock_irqrestore(&ch->ch_lock, flags);
@@ -428,7 +451,7 @@ static inline void neo_parse_isr(struct dgnc_board *brd, uint port)
* one it was, so we can suspend or resume
data flow. */
if (cause == UART_17158_XON_DETECT) {
- /* Is output stopped right now, if so,
resume it */
+ /* Is output stopped right now, if so, resume
it */ if (brd->channels[port]->ch_flags & CH_STOP) {
spin_lock_irqsave(&ch->ch_lock,
flags);
@@ -437,7 +460,8 @@ static inline void neo_parse_isr(struct dgnc_board *brd, uint port) flags);
}
} else if (cause == UART_17158_XOFF_DETECT) {
- if (!(brd->channels[port]->ch_flags &
CH_STOP)) {
+ if (!(brd->channels[port]->ch_flags &
+ CH_STOP)) {
spin_lock_irqsave(&ch->ch_lock,
flags);
ch->ch_flags |= CH_STOP;
@@ -449,8 +473,9 @@ static inline void neo_parse_isr(struct dgnc_board *brd, uint port)
if (isr & UART_17158_IIR_HWFLOW_STATE_CHANGE) {
/*
- * If we get here, this means the hardware is
doing auto flow control.
- * Check to see whether RTS/DTR or CTS/DSR
caused this interrupt.
+ * If we get here, this means the hardware is
+ * doing auto flow control. Check to see
whether
+ * RTS/DTR or CTS/DSR caused this interrupt.
*/
brd->intr_modem++; ch->ch_intr_modem++;
@@ -542,10 +567,11 @@ static inline void neo_parse_lsr(struct dgnc_board *brd, uint port)
if (linestatus & UART_LSR_OE) {
/*
- * Rx Oruns. Exar says that an orun will NOT corrupt
- * the FIFO. It will just replace the holding register
- * with this new data byte. So basically just ignore
this.
- * Probably we should eventually have an orun stat in
our driver...
+ * Rx Oruns. Exar says that an orun will NOT
+ * corrupt the FIFO. It will just replace the
+ * holding register with this new data byte.
+ * So basically just ignore this. Probably we
+ * should eventually have an orun stat in our driver.
*/
ch->ch_err_overrun++;
}
@@ -665,8 +691,11 @@ static void neo_param(struct tty_struct *tty)
4800, 9600, 19200, 38400 }
};

- /* Only use the TXPrint baud rate if the terminal unit
is NOT open */
- if (!(ch->ch_tun.un_flags & UN_ISOPEN) && (un->un_type
== DGNC_PRINT))
+ /* Only use the TXPrint baud rate if the
+ * terminal unit is NOT open.
+ */
+ if (!(ch->ch_tun.un_flags & UN_ISOPEN) &&
+ (un->un_type == DGNC_PRINT))
baud = C_BAUD(ch->ch_pun.un_tty) & 0xff;
else
baud = C_BAUD(ch->ch_tun.un_tty) & 0xff;
@@ -679,7 +708,8 @@ static void neo_param(struct tty_struct *tty)

jindex = baud;

- if ((iindex >= 0) && (iindex < 4) && (jindex >= 0) &&
(jindex < 16))
+ if ((iindex >= 0) && (iindex < 4) && (jindex >= 0)
+ && (jindex < 16))
baud = bauds[iindex][jindex];
else
baud = 0;
@@ -763,8 +793,9 @@ static void neo_param(struct tty_struct *tty)
ier &= ~(UART_IER_RDI | UART_IER_RLSI);

/*
- * Have the UART interrupt on modem signal changes ONLY when
- * we are in hardware flow control mode, or CLOCAL/FORCEDCD is
not set.
+ * Have the UART interrupt on modem signal changes
+ * ONLY when we are in hardware flow control mode,
+ * or CLOCAL/FORCEDCD is not set.
*/

 	if ((ch->ch_digi.digi_flags & CTSPACE) ||
 	    (ch->ch_digi.digi_flags & RTSPACE) ||

@@ -786,8 +817,11 @@ static void neo_param(struct tty_struct *tty)
if (ch->ch_digi.digi_flags & CTSPACE || ch->ch_c_cflag &
CRTSCTS) { neo_set_cts_flow_control(ch);
} else if (ch->ch_c_iflag & IXON) {
- /* If start/stop is set to disable, then we should
disable flow control */
- if ((ch->ch_startc == _POSIX_VDISABLE) ||
(ch->ch_stopc == _POSIX_VDISABLE))
+ /* If start/stop is set to disable, then we
+ * should disable flow control.
+ */
+ if ((ch->ch_startc == _POSIX_VDISABLE) ||
+ (ch->ch_stopc == _POSIX_VDISABLE))
neo_set_no_output_flow_control(ch);
else
neo_set_ixon_flow_control(ch);
@@ -798,8 +832,11 @@ static void neo_param(struct tty_struct *tty)
if (ch->ch_digi.digi_flags & RTSPACE || ch->ch_c_cflag &
CRTSCTS) { neo_set_rts_flow_control(ch);
} else if (ch->ch_c_iflag & IXOFF) {
- /* If start/stop is set to disable, then we should
disable flow control */
- if ((ch->ch_startc == _POSIX_VDISABLE) ||
(ch->ch_stopc == _POSIX_VDISABLE))
+ /* If start/stop is set to disable, then we should
+ * disable flow control.
+ */
+ if ((ch->ch_startc == _POSIX_VDISABLE) ||
+ (ch->ch_stopc == _POSIX_VDISABLE))
neo_set_no_input_flow_control(ch);
else
neo_set_ixoff_flow_control(ch);
@@ -808,9 +845,10 @@ static void neo_param(struct tty_struct *tty)
}

/*
- * Adjust the RX FIFO Trigger level if baud is less than 9600.
- * Not exactly elegant, but this is needed because of the Exar
chip's
- * delay on firing off the RX FIFO interrupt on slower baud
rates.
+ * Adjust the RX FIFO Trigger level if baud is less
+ * than 9600. Not exactly elegant, but this is needed
+ * because of the Exar chip's delay on firing off the
+ * RX FIFO interrupt on slower baud rates.
*/
if (baud < 9600) {
writeb(1, &ch->ch_neo_uart->rfifo);
@@ -845,13 +883,14 @@ static void neo_tasklet(unsigned long data)
spin_unlock_irqrestore(&bd->bd_lock, flags);

/*
- * Do NOT allow the interrupt routine to read the intr
registers
- * Until we release this lock.
+ * Do NOT allow the interrupt routine to read the
+ * intr registers. Until we release this lock.
*/
spin_lock_irqsave(&bd->bd_intr_lock, flags);

/*
- * If board is ready, parse deeper to see if there is anything
to do.
+ * If board is ready, parse deeper to see if there is
+ * anything to do.
*/
if ((state == BOARD_READY) && (ports > 0)) {
/* Loop on each port */
@@ -938,14 +977,17 @@ static irqreturn_t neo_intr(int irq, void *voidbrd)
/*
* If 0, no interrupts pending.
- * This can happen if the IRQ is shared among a couple
Neo/Classic boards.
+ * This can happen if the IRQ is shared among a couple
+ * Neo/Classic boards.
*/
if (!uart_poll) {
spin_unlock_irqrestore(&brd->bd_intr_lock, flags); return IRQ_NONE;
}

- /* At this point, we have at least SOMETHING to service, dig
further... */
+ /* At this point, we have at least SOMETHING to service,
+ * dig further...
+ */

current_port = 0;

@@ -967,7 +1009,7 @@ static irqreturn_t neo_intr(int irq, void *voidbrd)
uart_poll &= ~(dgnc_offset_table[port]);

if (!type) {
- /* If no type, just ignore it, and move onto
next port */
+ /* If no type, just ignore it, and move onto next port
*/ continue;
}

@@ -986,7 +1028,9 @@ static irqreturn_t neo_intr(int irq, void *voidbrd)
ch = brd->channels[port]; neo_copy_data_from_uart_to_queue(ch);

- /* Call our tty layer to enforce queue flow
control if needed. */
+ /* Call our tty layer to enforce queue flow
+ * control if needed.
+ */
spin_lock_irqsave(&ch->ch_lock, flags2); dgnc_check_queue_flow_control(ch); spin_unlock_irqrestore(&ch->ch_lock, flags2);
@@ -1002,16 +1046,18 @@ static irqreturn_t neo_intr(int irq, void *voidbrd)
case UART_17158_TXRDY:
/*
- * TXRDY interrupt clears after reading ISR
register for the UART channel.
+ * TXRDY interrupt clears after reading ISR
+ * register for the UART channel.
*/

/*
* Yes, this is odd...
- * Why would I check EVERY possibility of type
of
- * interrupt, when we know its TXRDY???
- * Becuz for some reason, even tho we got
triggered for TXRDY,
- * it seems to be occasionally wrong. Instead
of TX, which
- * it should be, I was getting things like
RXDY too. Weird.
+ * Why would I check EVERY possibility of type
+ * of interrupt, when we know its TXRDY???
+ * Becuz for some reason, even tho we got
triggered
+ * for TXRDY, it seems to be occasionally
wrong.
+ * Instead of TX, which it should be, I was
getting
+ * things like RXDY too. Weird.
*/
neo_parse_isr(brd, port);
continue;
@@ -1026,9 +1072,9 @@ static irqreturn_t neo_intr(int irq, void *voidbrd) default:
/*
* The UART triggered us with a bogus
interrupt type.
- * It appears the Exar chip, when REALLY
bogged down, will throw
- * these once and awhile.
- * Its harmless, just ignore it and move on.
+ * It appears the Exar chip, when REALLY
bogged down,
+ * will throw these once and awhile. Its
harmless,
+ * just ignore it and move on.
*/
continue;
}
@@ -1172,7 +1218,8 @@ static void neo_copy_data_from_uart_to_queue(struct channel_t *ch) linestatus = 0;

/* Copy data from uart to the queue */
- memcpy_fromio(ch->ch_rqueue + head,
&ch->ch_neo_uart->txrxburst, n);
+ memcpy_fromio(ch->ch_rqueue + head,
+ &ch->ch_neo_uart->txrxburst,
n);
/*
* Since RX_FIFO_DATA_ERROR was 0, we are guaranteed
@@ -1225,7 +1272,8 @@ static void neo_copy_data_from_uart_to_queue(struct channel_t *ch)
* we don't miss our TX FIFO emptys.
*/
if (linestatus & (UART_LSR_THRE |
UART_17158_TX_AND_FIFO_CLR)) {
- linestatus &= ~(UART_LSR_THRE |
UART_17158_TX_AND_FIFO_CLR);
+ linestatus &= ~(UART_LSR_THRE |
+ UART_17158_TX_AND_FIFO_CLR);
ch->ch_flags |= (CH_TX_FIFO_EMPTY |
CH_TX_FIFO_LWM); }

@@ -1236,17 +1284,19 @@ static void neo_copy_data_from_uart_to_queue(struct channel_t *ch) unsigned char discard;
linestatus = 0;
- memcpy_fromio(&discard,
&ch->ch_neo_uart->txrxburst, 1);
+ memcpy_fromio(&discard,
+ &ch->ch_neo_uart->txrxburst,
1); continue;
}

/*
- * If our queue is full, we have no choice but to drop
some data.
- * The assumption is that HWFLOW or SWFLOW should have
stopped
- * things way way before we got to this point.
+ * If our queue is full, we have no choice but to
+ * drop some data. The assumption is that HWFLOW
+ * or SWFLOW should have stopped things way way
+ * before we got to this point.
*
- * I decided that I wanted to ditch the oldest data
first,
- * I hope thats okay with everyone? Yes? Good.
+ * I decided that I wanted to ditch the oldest data
+ * first, I hope thats okay with everyone? Yes? Good.
*/
while (qleft < 1) {
tail = (tail + 1) & RQUEUEMASK;
@@ -1255,7 +1305,8 @@ static void neo_copy_data_from_uart_to_queue(struct channel_t *ch) qleft++;
}

- memcpy_fromio(ch->ch_rqueue + head,
&ch->ch_neo_uart->txrxburst, 1);
+ memcpy_fromio(ch->ch_rqueue + head,
+ &ch->ch_neo_uart->txrxburst,
1); ch->ch_equeue[head] = (unsigned char)linestatus;

/* Ditch any remaining linestatus value. */
@@ -1309,7 +1360,8 @@ static int neo_drain(struct tty_struct *tty, uint seconds) *
* NOTE: TODO: Do something with time passed in.
*/
- rc = wait_event_interruptible(un->un_flags_wait,
((un->un_flags & UN_EMPTY) == 0));
+ rc = wait_event_interruptible(un->un_flags_wait,
+ ((un->un_flags &
UN_EMPTY) == 0));
/* If ret is non-zero, user ctrl-c'ed us */
return rc;
@@ -1328,11 +1380,14 @@ static void neo_flush_uart_write(struct channel_t *ch) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return;

- writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_XMIT),
&ch->ch_neo_uart->isr_fcr);
+ writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_XMIT),
+ &ch->ch_neo_uart->isr_fcr);
neo_pci_posting_flush(ch->ch_bd);

for (i = 0; i < 10; i++) {
- /* Check to see if the UART feels it completely
flushed the FIFO. */
+ /* Check to see if the UART feels it completely
+ * flushed the FIFO.
+ */
tmp = readb(&ch->ch_neo_uart->isr_fcr); if (tmp & 4)
udelay(10);
@@ -1356,11 +1411,14 @@ static void neo_flush_uart_read(struct channel_t *ch) if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return;

- writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR),
&ch->ch_neo_uart->isr_fcr);
+ writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR),
+ &ch->ch_neo_uart->isr_fcr);
neo_pci_posting_flush(ch->ch_bd);

for (i = 0; i < 10; i++) {
- /* Check to see if the UART feels it completely
flushed the FIFO. */
+ /* Check to see if the UART feels it completely
+ * flushed the FIFO.
+ */
tmp = readb(&ch->ch_neo_uart->isr_fcr);
if (tmp & 2)
udelay(10);
@@ -1405,8 +1463,9 @@ static void neo_copy_data_from_queue_to_uart(struct channel_t *ch) ch->ch_cached_lsr &= ~(UART_LSR_THRE);
/*
- * If RTS Toggle mode is on, turn on RTS now
if not already set,
- * and make sure we get an event when the data
transfer has completed.
+ * If RTS Toggle mode is on, turn on RTS now if
+ * not already set, and make sure we get an
event
+ * when the data transfer has completed.
*/
if (ch->ch_digi.digi_flags & DIGI_RTS_TOGGLE) {
if (!(ch->ch_mostat & UART_MCR_RTS)) {
@@ -1416,8 +1475,9 @@ static void neo_copy_data_from_queue_to_uart(struct channel_t *ch) ch->ch_tun.un_flags |= (UN_EMPTY); }
/*
- * If DTR Toggle mode is on, turn on DTR now
if not already set,
- * and make sure we get an event when the data
transfer has completed.
+ * If DTR Toggle mode is on, turn on DTR now
if not
+ * already set, and make sure we get an event
when
+ * the data transfer has completed.
*/
if (ch->ch_digi.digi_flags & DIGI_DTR_TOGGLE) {
if (!(ch->ch_mostat & UART_MCR_DTR)) {
@@ -1427,7 +1487,8 @@ static void neo_copy_data_from_queue_to_uart(struct channel_t *ch) ch->ch_tun.un_flags |= (UN_EMPTY); }

- writeb(ch->ch_wqueue[ch->ch_w_tail],
&ch->ch_neo_uart->txrx);
+ writeb(ch->ch_wqueue[ch->ch_w_tail],
+ &ch->ch_neo_uart->txrx);
ch->ch_w_tail++; ch->ch_w_tail &= WQUEUEMASK; ch->ch_txcount++;
@@ -1471,8 +1532,9 @@ static void neo_copy_data_from_queue_to_uart(struct channel_t *ch) break;

/*
- * If RTS Toggle mode is on, turn on RTS now if not
already set,
- * and make sure we get an event when the data
transfer has completed.
+ * If RTS Toggle mode is on, turn on RTS now if not
+ * already set, and make sure we get an event when
+ * the data transfer has completed.
*/
if (ch->ch_digi.digi_flags & DIGI_RTS_TOGGLE) {
if (!(ch->ch_mostat & UART_MCR_RTS)) {
@@ -1483,8 +1545,9 @@ static void neo_copy_data_from_queue_to_uart(struct channel_t *ch) }

/*
- * If DTR Toggle mode is on, turn on DTR now if not
already set,
- * and make sure we get an event when the data
transfer has completed.
+ * If DTR Toggle mode is on, turn on DTR now if not
+ * already set, and make sure we get an event when
+ * the data transfer has completed.
*/
if (ch->ch_digi.digi_flags & DIGI_DTR_TOGGLE) {
if (!(ch->ch_mostat & UART_MCR_DTR)) {
@@ -1494,7 +1557,8 @@ static void neo_copy_data_from_queue_to_uart(struct channel_t *ch) ch->ch_tun.un_flags |= (UN_EMPTY); }

- memcpy_toio(&ch->ch_neo_uart->txrxburst, ch->ch_wqueue
+ tail, s);
+ memcpy_toio(&ch->ch_neo_uart->txrxburst,
+ ch->ch_wqueue + tail, s);

/* Add and flip queue if needed */
tail = (tail + s) & WQUEUEMASK;
@@ -1547,7 +1611,9 @@ static void neo_parse_modem(struct channel_t *ch, unsigned char signals) }
}

- /* Scrub off lower bits. They signify delta's, which I don't
care about */
+ /* Scrub off lower bits. They signify delta's,
+ * which I don't care about.
+ */
msignals &= 0xf0;

if (msignals & UART_MSR_DCD)
@@ -1628,7 +1694,8 @@ static void neo_uart_init(struct channel_t *ch)

/* Clear out UART and FIFO */ readb(&ch->ch_neo_uart->txrx);
- writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT), &ch->ch_neo_uart->isr_fcr);
+ writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR
+ | UART_FCR_CLEAR_XMIT), &ch->ch_neo_uart->isr_fcr);
readb(&ch->ch_neo_uart->lsr); readb(&ch->ch_neo_uart->msr);

@@ -1725,7 +1792,8 @@ static void neo_send_immediate_char(struct channel_t *ch, unsigned char c) neo_pci_posting_flush(ch->ch_bd);
}

-static unsigned int neo_read_eeprom(unsigned char __iomem *base, unsigned int address) +static unsigned int neo_read_eeprom(unsigned char __iomem *base,
+ unsigned int address)
{
unsigned int enable;
unsigned int bits;
@@ -1779,12 +1847,13 @@ static void neo_vpd(struct dgnc_board *brd)
/* Store the VPD into our buffer */
for (i = 0; i < NEO_VPD_IMAGESIZE; i++) {
a = neo_read_eeprom(brd->re_map_membase, i);
- brd->vpd[i*2] = a & 0xff;
- brd->vpd[(i*2)+1] = (a >> 8) & 0xff;
+ brd->vpd[i * 2] = a & 0xff;
+ brd->vpd[(i * 2) + 1] = (a >> 8) & 0xff;
}

if (((brd->vpd[0x08] != 0x82) /* long resource name
tag */
- && (brd->vpd[0x10] != 0x82)) /* long resource name
tag (PCI-66 files)*/
+ && (brd->vpd[0x10] != 0x82))
+ /* long resource nametag (PCI-66 files)*/
|| (brd->vpd[0x7F] != 0x78)) { /* small resource end
tag */
memset(brd->vpd, '\0', NEO_VPD_IMAGESIZE);

(quoted diff) +0 -0

b/drivers/staging/dgnc/dgnc_neo.h index c528df5..5be232f 100644

drivers/staging/dgnc/dgnc_neo.h +0 -1
@@ -30,7 +30,8 @@
 struct neo_uart_struct {
 	u8 txrx;		/* WR  RHR/THR - Holding Reg */
 	u8 ier;		/* WR  IER - Interrupt Enable Reg */
-	u8 isr_fcr;		/* WR  ISR/FCR - Interrupt Status

Reg/Fifo Control Reg */
+ u8 isr_fcr;
+ /* WR ISR/FCR - Interrupt Status Reg/Fifo Control Reg */

 	u8 lcr;		/* WR  LCR - Line Control Reg */
 	u8 mcr;		/* WR  MCR - Modem Control Reg */
 	u8 lsr;		/* WR  LSR - Line Status Reg */

@@ -65,8 +66,8 @@ struct neo_uart_struct {
#define NEO_EEDO 0x80 /* Data Out is an Input Pin */
#define NEO_EEREG 0x8E /* offset to EEPROM control reg
*/
-
-#define NEO_VPD_IMAGESIZE 0x40 /* size of image to read from
EEPROM in words */ +#define NEO_VPD_IMAGESIZE 0x40 +/* size of image to read from EEPROM in words */
#define NEO_VPD_IMAGEBYTES (NEO_VPD_IMAGESIZE * 2)

/*
@@ -109,7 +110,8 @@ struct neo_uart_struct {
/* 17158 Extended IIR's */
#define UART_17158_IIR_RDI_TIMEOUT 0x0C /* Receiver data
TIMEOUT */ #define UART_17158_IIR_XONXOFF 0x10 /*
Received an XON/XOFF char */ -#define
UART_17158_IIR_HWFLOW_STATE_CHANGE 0x20 /* CTS/DSR or RTS/DTR
state change */ +#define UART_17158_IIR_HWFLOW_STATE_CHANGE 0x20 +/* CTS/DSR or RTS/DTR state change */ #define
UART_17158_IIR_FIFO_ENABLED 0xC0 /* 16550 FIFOs are
Enabled */ /*
@@ -120,8 +122,10 @@ struct neo_uart_struct {
#define UART_17158_RXRDY_TIMEOUT 0x2 /* RX Ready Timeout
*/ #define UART_17158_TXRDY 0x3 /* TX Ready */
#define UART_17158_MSR 0x4 /* Modem
State Change */ -#define UART_17158_TX_AND_FIFO_CLR
0x40 /* Transmitter Holding Reg Empty */ -#define
UART_17158_RX_FIFO_DATA_ERROR 0x80 /* UART detected an RX
FIFO Data error */ +#define UART_17158_TX_AND_FIFO_CLR 0x40 +/*
Transmitter Holding Reg Empty */ +#define
UART_17158_RX_FIFO_DATA_ERROR 0x80 +/* UART detected an RX FIFO
Data error */
/*
* These are the EXTENDED definitions for the 17C158's Interrupt
@@ -133,8 +137,10 @@ struct neo_uart_struct {
#define UART_17158_EFR_RTSDTR 0x40 /* Auto RTS/DTR Flow
Control Enable */ #define UART_17158_EFR_CTSDSR 0x80 /*
Auto CTS/DSR Flow COntrol Enable */
-#define UART_17158_XOFF_DETECT 0x1 /* Indicates whether
chip saw an incoming XOFF char */ -#define
UART_17158_XON_DETECT 0x2 /* Indicates whether chip saw
an incoming XON char */ +#define UART_17158_XOFF_DETECT 0x1 +/*
Indicates whether chip saw an incoming XOFF char */ +#define
UART_17158_XON_DETECT 0x2 +/* Indicates whether chip saw an
incoming XON char */
#define UART_17158_IER_RSVD1 0x10 /* Reserved by Exar */
#define UART_17158_IER_XOFF 0x20 /* Xoff Interrupt
Enable */ diff --git a/drivers/staging/dgnc/dgnc_pci.h b/drivers/staging/dgnc/dgnc_pci.h index 617d40d..4e170c4 100644

drivers/staging/dgnc/dgnc_pci.h +0 -0
@@ -59,7 +59,6 @@
 #define PCI_DEVICE_NEO_EXPRESS_8RJ45_PCI_NAME	"Neo 8 PCI

Express RJ45" #define PCI_DEVICE_NEO_EXPRESS_4_IBM_PCI_NAME "Neo
4 PCI Express IBM"
-
/* Size of Memory and I/O for PCI (4 K) */
#define PCI_RAM_SIZE 0x1000

(quoted diff) +0 -0

b/drivers/staging/dgnc/dgnc_sysfs.c index 74a0725..db7951f 100644

drivers/staging/dgnc/dgnc_sysfs.c +0 -0
@@ -193,12 +193,18 @@ static ssize_t dgnc_ports_msignals_show(struct

device *p, count += snprintf(buf + count, PAGE_SIZE - count,
"%d %s %s %s %s %s %s\n", bd->channels[i]->ch_portnum,
- (bd->channels[i]->ch_mostat &
UART_MCR_RTS) ? "RTS" : "",
- (bd->channels[i]->ch_mistat &
UART_MSR_CTS) ? "CTS" : "",
- (bd->channels[i]->ch_mostat &
UART_MCR_DTR) ? "DTR" : "",
- (bd->channels[i]->ch_mistat &
UART_MSR_DSR) ? "DSR" : "",
- (bd->channels[i]->ch_mistat &
UART_MSR_DCD) ? "DCD" : "",
- (bd->channels[i]->ch_mistat &
UART_MSR_RI) ? "RI" : "");
+ (bd->channels[i]->ch_mostat &
UART_MCR_RTS)
+ ? "RTS" : "",
+ (bd->channels[i]->ch_mistat &
UART_MSR_CTS)
+ ? "CTS" : "",
+ (bd->channels[i]->ch_mostat &
UART_MCR_DTR)
+ ? "DTR" : "",
+ (bd->channels[i]->ch_mistat &
UART_MSR_DSR)
+ ? "DSR" : "",
+ (bd->channels[i]->ch_mistat &
UART_MSR_DCD)
+ ? "DCD" : "",
+ (bd->channels[i]->ch_mistat &
UART_MSR_RI)
+ ? "RI" : "");
} else {
count += snprintf(buf + count, PAGE_SIZE -
count, "%d\n", bd->channels[i]->ch_portnum);

(quoted diff) +0 -0

b/drivers/staging/dgnc/dgnc_tty.c index 48e4b90..d07e168 100644

drivers/staging/dgnc/dgnc_tty.c +2 -3
@@ -443,15 +443,16 @@ void dgnc_tty_uninit(struct dgnc_board *brd)
 	brd->PrintDriver.termios = NULL;
 }
 
-/*=======================================================================
+/*==================================================================
  *
  *	dgnc_wmove - Write data to transmit queue.
  *
  *		ch	- Pointer to channel structure.
- *		buf	- Poiter to characters to be moved.
+ *		buf	- Pointer to characters to be moved.
  *		n	- Number of characters to move.
  *
-

*=======================================================================*/
+ *==================================================================
+ */
static void dgnc_wmove(struct channel_t *ch, char *buf, uint n) {
int remain;
@@ -489,13 +490,14 @@ static void dgnc_wmove(struct channel_t *ch, char *buf, uint n) ch->ch_w_head = head;
}

-/*======================================================================= +/*================================================================
*
* dgnc_input - Process received data.
*
* ch - Pointer to channel structure.
*
- *=======================================================================*/
+ *================================================================
+ */
void dgnc_input(struct channel_t *ch)
{
struct dgnc_board *bd;
@@ -936,7 +938,8 @@ void dgnc_wakeup_writes(struct channel_t *ch)
if ((ch->ch_tun.un_tty->flags & (1 <<
TTY_DO_WRITE_WAKEUP)) && ch->ch_tun.un_tty->ldisc->ops->write_wakeup) {
spin_unlock_irqrestore(&ch->ch_lock, flags);
- ch->ch_tun.un_tty->ldisc->ops->write_wakeup(ch->ch_tun.un_tty);
+ ch->ch_tun.un_tty->ldisc->ops->write_wakeup
+ (ch->ch_tun.un_tty);
spin_lock_irqsave(&ch->ch_lock, flags);
}

@@ -956,7 +959,8 @@ void dgnc_wakeup_writes(struct channel_t *ch)
* the queue and UART is empty, keep
RTS low. */
if (ch->ch_digi.digi_flags &
DIGI_RTS_TOGGLE) {
- ch->ch_mostat &=
~(UART_MCR_RTS);
+ ch->ch_mostat &=
+
~(UART_MCR_RTS); ch->ch_bd->bd_ops->assert_modem_signals(ch);
}

@@ -966,7 +970,8 @@ void dgnc_wakeup_writes(struct channel_t *ch)
*/
if (ch->ch_digi.digi_flags &
DIGI_DTR_TOGGLE) { ch->ch_mostat &= ~(UART_MCR_DTR);
-
ch->ch_bd->bd_ops->assert_modem_signals(ch);
+ ch->ch_bd->bd_ops->
+
assert_modem_signals(ch); }
}
}
@@ -978,7 +983,8 @@ void dgnc_wakeup_writes(struct channel_t *ch)
if ((ch->ch_pun.un_tty->flags & (1 <<
TTY_DO_WRITE_WAKEUP)) && ch->ch_pun.un_tty->ldisc->ops->write_wakeup) {
spin_unlock_irqrestore(&ch->ch_lock, flags);
- ch->ch_pun.un_tty->ldisc->ops->write_wakeup(ch->ch_pun.un_tty);
+ ch->ch_pun.un_tty->ldisc->ops->write_wakeup
+ (ch->ch_pun.un_tty);
spin_lock_irqsave(&ch->ch_lock, flags);
}

@@ -2520,12 +2526,12 @@ static void dgnc_tty_flush_buffer(struct tty_struct *tty) /* Flush UARTs transmit FIFO */
ch->ch_bd->bd_ops->flush_uart_write(ch);

- if (ch->ch_tun.un_flags & (UN_LOW|UN_EMPTY)) {
- ch->ch_tun.un_flags &= ~(UN_LOW|UN_EMPTY);
+ if (ch->ch_tun.un_flags & (UN_LOW | UN_EMPTY)) {
+ ch->ch_tun.un_flags &= ~(UN_LOW | UN_EMPTY);
wake_up_interruptible(&ch->ch_tun.un_flags_wait);
}
- if (ch->ch_pun.un_flags & (UN_LOW|UN_EMPTY)) {
- ch->ch_pun.un_flags &= ~(UN_LOW|UN_EMPTY);
+ if (ch->ch_pun.un_flags & (UN_LOW | UN_EMPTY)) {
+ ch->ch_pun.un_flags &= ~(UN_LOW | UN_EMPTY);
wake_up_interruptible(&ch->ch_pun.un_flags_wait);
}

@@ -2717,16 +2723,18 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, ch->ch_w_head = ch->ch_w_tail;
ch->ch_bd->bd_ops->flush_uart_write(ch);

- if (ch->ch_tun.un_flags &
(UN_LOW|UN_EMPTY)) {
+ if (ch->ch_tun.un_flags & (UN_LOW |
UN_EMPTY)) { ch->ch_tun.un_flags &=
- ~(UN_LOW|UN_EMPTY);
-
wake_up_interruptible(&ch->ch_tun.un_flags_wait);
+ ~(UN_LOW | UN_EMPTY);
+ wake_up_interruptible
+
(&ch->ch_tun.un_flags_wait); }

- if (ch->ch_pun.un_flags &
(UN_LOW|UN_EMPTY)) {
+ if (ch->ch_pun.un_flags & (UN_LOW |
UN_EMPTY)) { ch->ch_pun.un_flags &=
- ~(UN_LOW|UN_EMPTY);
-
wake_up_interruptible(&ch->ch_pun.un_flags_wait);
+ ~(UN_LOW | UN_EMPTY);
+ wake_up_interruptible
+
(&ch->ch_pun.un_flags_wait); }
}
}

drivers/staging/dgnc/digi.h +0 -1
index cf9dcae..e202aac 100644
@@ -31,21 +31,21 @@
 #endif
 
 #if !defined(TIOCMSET)
-#define	TIOCMSET	(('d'<<8) | 252)	/* set modem

ctrl state */ -#define TIOCMGET (('d'<<8) |
253) /* set modem ctrl state */ +#define
TIOCMSET (('d' << 8) | 252) /* set modem ctrl
state */ +#define TIOCMGET (('d' << 8) |
253) /* set modem ctrl state */ #endif
#if !defined(TIOCMBIC)
-#define TIOCMBIC (('d'<<8) | 254) /* set modem
ctrl state */ -#define TIOCMBIS (('d'<<8) |
255) /* set modem ctrl state */ +#define TIOCMBIC
(('d' << 8) | 254) /* set modem ctrl state */ +#define
TIOCMBIS (('d' << 8) | 255) /* set modem ctrl state */
#endif
-#define DIGI_GETA (('e'<<8) | 94) /* Read
params */ -#define DIGI_SETA (('e'<<8) |
95) /* Set params */ -#define
DIGI_SETAW (('e'<<8) | 96) /* Drain & set
params */ -#define DIGI_SETAF (('e'<<8) |
97) /* Drain, flush & set params */ -#define
DIGI_GET_NI_INFO (('d'<<8) | 250) /* Non-intelligent state info */ -#define DIGI_LOOPBACK (('d'<<8) | 252) /* +#define DIGI_GETA

(('e' << 8) | 94)	/* Read params*/ +#define DIGI_SETA
(('e' << 8) | 95)	/* Set params*/ +#define DIGI_SETAW
(('e' << 8) | 96)	/* Drain & set params*/ +#define

DIGI_SETAF (('e' << 8) | 97) /* Drain, flush & set
params*/ +#define DIGI_GET_NI_INFO (('d' << 8) | 250) /* Non-intelligent state info */ +#define DIGI_LOOPBACK (('d' << 8) |
252) /*
* Enable/disable UART
* internal loopback */
@@ -85,7 +85,7 @@ struct digi_dinfo {
char dinfo_version[16]; /* driver
version */ };

-#define DIGI_GETDD (('d'<<8) | 248) /* get driver
info */ +#define DIGI_GETDD (('d' << 8) |
248) /* get driver info */
/************************************************************************
* Structure used with ioctl commands for per-board information
@@ -105,7 +105,7 @@ struct digi_info {
char info_reserved[7]; /* for future
expansion */ };

-#define DIGI_GETBD (('d'<<8) | 249) /* get board
info */ +#define DIGI_GETBD (('d' << 8) |
249) /* get board info */
struct digi_getbuffer /* Struct for holding buffer use counts */ {
@@ -133,10 +133,10 @@ struct digi_getcounter {
#define DIGI_SETCUSTOMBAUD _IOW('e', 106, int) /* Set integer
baud rate */ #define DIGI_GETCUSTOMBAUD _IOR('e', 107, int) /*
Get integer baud rate */
-#define DIGI_REALPORT_GETBUFFERS (('e'<<8) | 108) -#define DIGI_REALPORT_SENDIMMEDIATE (('e'<<8) | 109) -#define DIGI_REALPORT_GETCOUNTERS (('e'<<8) | 110) -#define DIGI_REALPORT_GETEVENTS (('e'<<8) | 111) +#define DIGI_REALPORT_GETBUFFERS (('e' << 8) | 108) +#define DIGI_REALPORT_SENDIMMEDIATE (('e' << 8) | 109) +#define DIGI_REALPORT_GETCOUNTERS (('e' << 8) | 110) +#define DIGI_REALPORT_GETEVENTS (('e' << 8) | 111)

#define EV_OPU 0x0001 /* !<Output paused by client */ #define EV_OPS 0x0002 /* !<Output paused by reqular sw flowctrl */

Signature · 1 line
2.5.0
#21 lore raw

Re: [PATCH 2/3] staging: dgnc: Patch includes CamelCase & Macro fixes

In reply to Sanidhya Solanki

Patch contains the CamelCase fixes & Macro fixes that led to checkpatch.pl errors.

---
 drivers/staging/dgnc/dgnc_driver.c |  56 ++++-----
 drivers/staging/dgnc/dgnc_driver.h |  25 ++--
 drivers/staging/dgnc/dgnc_mgmt.c   |  28 ++---
 drivers/staging/dgnc/dgnc_neo.c    | 226 +++++++++++++++++--------------------
 drivers/staging/dgnc/dgnc_sysfs.c  | 134 +++++++++++++++++-----
 drivers/staging/dgnc/dgnc_tty.c    | 197 ++++++++++++++++----------------
 drivers/staging/dgnc/digi.h        |  20 ++--
 7 files changed, 367 insertions(+), 319 deletions(-)
drivers/staging/dgnc/dgnc_driver.c +28 -28
index fc6d298..37fb8f9 100644
@@ -48,7 +48,7 @@ static void		dgnc_do_remap(struct dgnc_board *brd);
 /*
  * File operations permitted on Control/Management major.
  */
-static const struct file_operations dgnc_BoardFops = {
+static const struct file_operations dgnc_board_fops = {
 	.owner		=	THIS_MODULE,
 	.unlocked_ioctl =	dgnc_mgmt_ioctl,
 	.open		=	dgnc_mgmt_open,
@@ -58,11 +58,11 @@ static const struct file_operations dgnc_BoardFops = {
 /*
  * Globals
  */
-uint			dgnc_NumBoards;
-struct dgnc_board		*dgnc_Board[MAXBOARDS];
+uint			dgnc_num_boards;
+struct dgnc_board		*dgnc_board[MAXBOARDS];
 DEFINE_SPINLOCK(dgnc_global_lock);
 DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
-uint			dgnc_Major;
+uint			dgnc_major;
 int			dgnc_poll_tick = 20;	/* Poll interval - 20 ms */
 
 /*
@@ -92,7 +92,7 @@ struct board_id {
 	unsigned int is_pci_express;
 };
 
-static struct board_id dgnc_Ids[] = {
+static struct board_id dgnc_ids[] = {
 	{	PCI_DEVICE_CLASSIC_4_PCI_NAME,		4,	0	},
 	{	PCI_DEVICE_CLASSIC_4_422_PCI_NAME,	4,	0	},
 	{	PCI_DEVICE_CLASSIC_8_PCI_NAME,		8,	0	},
@@ -144,19 +144,19 @@ static void dgnc_cleanup_module(void)
 
 	dgnc_remove_driver_sysfiles(&dgnc_driver);
 
-	device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+	device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
 	class_destroy(dgnc_class);
-	unregister_chrdev(dgnc_Major, "dgnc");
+	unregister_chrdev(dgnc_major, "dgnc");
 
-	for (i = 0; i < dgnc_NumBoards; ++i) {
-		dgnc_remove_ports_sysfiles(dgnc_Board[i]);
-		dgnc_tty_uninit(dgnc_Board[i]);
-		dgnc_cleanup_board(dgnc_Board[i]);
+	for (i = 0; i < dgnc_num_boards; ++i) {
+		dgnc_remove_ports_sysfiles(dgnc_board[i]);
+		dgnc_tty_uninit(dgnc_board[i]);
+		dgnc_cleanup_board(dgnc_board[i]);
 	}
 
 	dgnc_tty_post_uninit();
 
-	if (dgnc_NumBoards)
+	if (dgnc_num_boards)
 		pci_unregister_driver(&dgnc_driver);
 }
 
@@ -187,7 +187,7 @@ static int __init dgnc_init_module(void)
 	 */
 	if (rc < 0) {
 		/* Only unregister if it was actually registered. */
-		if (dgnc_NumBoards)
+		if (dgnc_num_boards)
 			pci_unregister_driver(&dgnc_driver);
 		else
 			pr_warn("WARNING: dgnc driver load failed.  No Digi Neo or Classic boards found.\n");
@@ -222,12 +222,12 @@ static int dgnc_start(void)
 	 *
 	 * Register management/dpa devices
 	 */
-	rc = register_chrdev(0, "dgnc", &dgnc_BoardFops);
+	rc = register_chrdev(0, "dgnc", &dgnc_board_fops);
 	if (rc < 0) {
 		pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc);
 		return rc;
 	}
-	dgnc_Major = rc;
+	dgnc_major = rc;
 
 	dgnc_class = class_create(THIS_MODULE, "dgnc_mgmt");
 	if (IS_ERR(dgnc_class)) {
@@ -237,7 +237,7 @@ static int dgnc_start(void)
 	}
 
 	dev = device_create(dgnc_class, NULL,
-			    MKDEV(dgnc_Major, 0),
+			    MKDEV(dgnc_major, 0),
 			NULL, "dgnc_mgmt");
 	if (IS_ERR(dev)) {
 		rc = PTR_ERR(dev);
@@ -267,11 +267,11 @@ static int dgnc_start(void)
 	return 0;
 
 failed_tty:
-	device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+	device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
 failed_device:
 	class_destroy(dgnc_class);
 failed_class:
-	unregister_chrdev(dgnc_Major, "dgnc");
+	unregister_chrdev(dgnc_major, "dgnc");
 	return rc;
 }
 
@@ -288,7 +288,7 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	} else {
 		rc = dgnc_found_board(pdev, ent->driver_data);
 		if (rc == 0)
-			dgnc_NumBoards++;
+			dgnc_num_boards++;
 	}
 	return rc;
 }
@@ -351,7 +351,7 @@ static void dgnc_cleanup_board(struct dgnc_board *brd)
 		}
 	}
 
-	dgnc_Board[brd->boardnum] = NULL;
+	dgnc_board[brd->boardnum] = NULL;
 
 	kfree(brd);
 }
@@ -370,8 +370,8 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 	unsigned long flags;
 
 	/* get the board structure and prep it */
-	dgnc_Board[dgnc_NumBoards] = kzalloc(sizeof(*brd), GFP_KERNEL);
-	brd = dgnc_Board[dgnc_NumBoards];
+	dgnc_board[dgnc_num_boards] = kzalloc(sizeof(*brd), GFP_KERNEL);
+	brd = dgnc_board[dgnc_num_boards];
 
 	if (!brd)
 		return -ENOMEM;
@@ -387,15 +387,15 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 
 	/* store the info for the board we've found */
 	brd->magic = DGNC_BOARD_MAGIC;
-	brd->boardnum = dgnc_NumBoards;
+	brd->boardnum = dgnc_num_boards;
 	brd->vendor = dgnc_pci_tbl[id].vendor;
 	brd->device = dgnc_pci_tbl[id].device;
 	brd->pdev = pdev;
 	brd->pci_bus = pdev->bus->number;
 	brd->pci_slot = PCI_SLOT(pdev->devfn);
-	brd->name = dgnc_Ids[id].name;
-	brd->maxports = dgnc_Ids[id].maxports;
-	if (dgnc_Ids[i].is_pci_express)
+	brd->name = dgnc_ids[id].name;
+	brd->maxports = dgnc_ids[id].maxports;
+	if (dgnc_ids[i].is_pci_express)
 		brd->bd_flags |= BD_IS_PCI_EXPRESS;
 	brd->dpastatus = BD_NOFEP;
 	init_waitqueue_head(&brd->state_wait);
@@ -647,8 +647,8 @@ static void dgnc_poll_handler(ulong dummy)
 	unsigned long new_time;
 
 	/* Go thru each board, kicking off a tasklet for each if needed */
-	for (i = 0; i < dgnc_NumBoards; i++) {
-		brd = dgnc_Board[i];
+	for (i = 0; i < dgnc_num_boards; i++) {
+		brd = dgnc_board[i];
 
 		spin_lock_irqsave(&brd->bd_lock, flags);
 
drivers/staging/dgnc/dgnc_driver.h +13 -12
index e4be81b..7bed033 100644
@@ -24,6 +24,7 @@
 #include <linux/types.h>
 #include <linux/tty.h>
 #include <linux/interrupt.h>
+#include <linux/spinlock_types.h>
 
 #include "digi.h"		/* Digi specific ioctl header */
 #include "dgnc_sysfs.h"		/* Support for SYSFS */
@@ -202,18 +203,18 @@ struct dgnc_board {
 						 * to our channels.
 						 */
 
-	struct tty_driver	SerialDriver;
-	char		SerialName[200];
-	struct tty_driver	PrintDriver;
-	char		PrintName[200];
+	struct tty_driver	serial_driver;
+	char		serial_name[200];
+	struct tty_driver	print_driver;
+	char		print_name[200];
 
-	bool		dgnc_Major_Serial_Registered;
-	bool		dgnc_Major_TransparentPrint_Registered;
+	bool		dgnc_major_serial_registered;
+	bool		dgnc_major_transparent_print_registered;
 
-	uint		dgnc_Serial_Major;
-	uint		dgnc_TransparentPrint_Major;
+	uint		dgnc_serial_major;
+	uint		dgnc_transparent_print_major;
 
-	uint		TtyRefCnt;
+	uint		tty_ref_cnt;
 
 	u16		dpatype;	/* The board "type",
 					 * as defined by DPA
@@ -399,12 +400,12 @@ struct channel_t {
 /*
  * Our Global Variables.
  */
-extern uint		dgnc_Major;		/* Our driver/mgmt major */
+extern uint		dgnc_major;		/* Our driver/mgmt major */
 extern int		dgnc_poll_tick;		/* Poll interval - 20 ms */
 extern spinlock_t	dgnc_global_lock;	/* Driver global spinlock */
 extern spinlock_t	dgnc_poll_lock;		/* Poll scheduling lock */
-extern uint		dgnc_NumBoards;		/* Total number of boards */
-extern struct dgnc_board	*dgnc_Board[MAXBOARDS];	/* Array of board
+extern uint		dgnc_num_boards;	/* Total number of boards */
+extern struct dgnc_board	*dgnc_board[MAXBOARDS];	/* Array of board
 							 * structs
 							 */
 
drivers/staging/dgnc/dgnc_mgmt.c +14 -14
index 518fbd5..35a9295 100644
@@ -111,7 +111,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		spin_lock_irqsave(&dgnc_global_lock, flags);
 
 		memset(&ddi, 0, sizeof(ddi));
-		ddi.dinfo_nboards = dgnc_NumBoards;
+		ddi.dinfo_nboards = dgnc_num_boards;
 		sprintf(ddi.dinfo_version, "%s", DG_PART);
 
 		spin_unlock_irqrestore(&dgnc_global_lock, flags);
@@ -131,27 +131,27 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		if (copy_from_user(&brd, uarg, sizeof(int)))
 			return -EFAULT;
 
-		if (brd < 0 || brd >= dgnc_NumBoards)
+		if (brd < 0 || brd >= dgnc_num_boards)
 			return -ENODEV;
 
 		memset(&di, 0, sizeof(di));
 
 		di.info_bdnum = brd;
 
-		spin_lock_irqsave(&dgnc_Board[brd]->bd_lock, flags);
+		spin_lock_irqsave(&dgnc_board[brd]->bd_lock, flags);
 
-		di.info_bdtype = dgnc_Board[brd]->dpatype;
-		di.info_bdstate = dgnc_Board[brd]->dpastatus;
+		di.info_bdtype = dgnc_board[brd]->dpatype;
+		di.info_bdstate = dgnc_board[brd]->dpastatus;
 		di.info_ioport = 0;
-		di.info_physaddr = (ulong)dgnc_Board[brd]->membase;
-		di.info_physsize = (ulong)dgnc_Board[brd]->membase
-			- dgnc_Board[brd]->membase_end;
-		if (dgnc_Board[brd]->state != BOARD_FAILED)
-			di.info_nports = dgnc_Board[brd]->nasync;
+		di.info_physaddr = (ulong)dgnc_board[brd]->membase;
+		di.info_physsize = (ulong)dgnc_board[brd]->membase
+			- dgnc_board[brd]->membase_end;
+		if (dgnc_board[brd]->state != BOARD_FAILED)
+			di.info_nports = dgnc_board[brd]->nasync;
 		else
 			di.info_nports = 0;
 
-		spin_unlock_irqrestore(&dgnc_Board[brd]->bd_lock, flags);
+		spin_unlock_irqrestore(&dgnc_board[brd]->bd_lock, flags);
 
 		if (copy_to_user(uarg, &di, sizeof(di)))
 			return -EFAULT;
@@ -174,14 +174,14 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		channel = ni.channel;
 
 		/* Verify boundaries on board */
-		if (board >= dgnc_NumBoards)
+		if (board >= dgnc_num_boards)
 			return -ENODEV;
 
 		/* Verify boundaries on channel */
-		if (channel >= dgnc_Board[board]->nasync)
+		if (channel >= dgnc_board[board]->nasync)
 			return -ENODEV;
 
-		ch = dgnc_Board[board]->channels[channel];
+		ch = dgnc_board[board]->channels[channel];
 
 		if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
 			return -ENODEV;
drivers/staging/dgnc/dgnc_neo.c +103 -123

519 lines not on this page · raw message

drivers/staging/dgnc/dgnc_sysfs.c +103 -31

229 lines not on this page · raw message

drivers/staging/dgnc/dgnc_tty.c +96 -101

390 lines not on this page · raw message

drivers/staging/dgnc/digi.h +10 -10
index e202aac..701312f 100644
@@ -40,10 +40,10 @@
 #define	TIOCMBIS	(('d' << 8) | 255)	/* set modem ctrl state */
 #endif
 
-#define DIGI_GETA	(('e' << 8) | 94)	/* Read params*/
-#define DIGI_SETA	(('e' << 8) | 95)	/* Set params*/
-#define DIGI_SETAW	(('e' << 8) | 96)	/* Drain & set params*/
-#define DIGI_SETAF	(('e' << 8) | 97)	/* Drain, flush & set params*/
+#define DIGI_GETA	(('e' << 8) | 94)	/* Read params		*/
+#define DIGI_SETA	(('e' << 8) | 95)	/* Set params		*/
+#define DIGI_SETAW	(('e' << 8) | 96)	/* Drain & set params	*/
+#define DIGI_SETAF	(('e' << 8) | 97)	/* Drain, flush & set params */
 #define DIGI_GET_NI_INFO (('d' << 8) | 250) /* Non-intelligent state info */
 #define DIGI_LOOPBACK (('d' << 8) | 252) /*
 					* Enable/disable UART
@@ -94,10 +94,10 @@ struct digi_dinfo {
  ************************************************************************/
 struct digi_info {
 	unsigned int	info_bdnum;		/* Board number (0 based)  */
-	unsigned int	info_ioport;		/* io port address         */
-	unsigned int	info_physaddr;		/* memory address          */
-	unsigned int	info_physsize;		/* Size of host mem window */
-	unsigned int	info_memsize;		/* Amount of dual-port mem */
+	unsigned int	info_ioport;	/* io port address         */
+	unsigned int	info_physaddr;	/* memory address          */
+	unsigned int	info_physsize;	/* Size of host mem window */
+	unsigned int	info_memsize;	/* Amount of dual-port mem */
 						/* on board                */
 	unsigned short	info_bdtype;		/* Board type              */
 	unsigned short	info_nports;		/* number of ports         */
@@ -109,8 +109,8 @@ struct digi_info {
 
 struct digi_getbuffer /* Struct for holding buffer use counts */
 {
-	unsigned long tIn;
-	unsigned long tOut;
+	unsigned long t_in;
+	unsigned long t_out;
 	unsigned long rxbuf;
 	unsigned long txbuf;
 	unsigned long txdone;
Signature · 1 line
2.5.0
#25 lore raw

Re: [PATCH 3/3] staging: dgnc: Patch updates the TODO file

In reply to Greg KH

Patch updates the TODO file.

---
 drivers/staging/dgnc/TODO | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/dgnc/TODO +0 -1
index 0e0825b..0bdfd26 100644
@@ -1,4 +1,3 @@
-* checkpatch fixes
 * remove unnecessary comments
 * remove unnecessary error messages. Example kzalloc() has its
   own error message. Adding an extra one is useless.
Signature · 1 line
2.5.0
#23 lore raw
In reply to Sanidhya Solanki
Quoted 14 lines · Sanidhya Solanki

Patch contains the spacing fixes that led to checkpatch.pl warnings.

---
 drivers/staging/dgnc/dgnc_cls.c    |   4 +-
 drivers/staging/dgnc/dgnc_driver.h |   8 --
 drivers/staging/dgnc/dgnc_neo.c    | 235
++++++++++++++++++++++++-------------
drivers/staging/dgnc/dgnc_neo.h    |  22 ++--
drivers/staging/dgnc/dgnc_pci.h    |   1 -
drivers/staging/dgnc/dgnc_sysfs.c  |  18 ++-
drivers/staging/dgnc/dgnc_tty.c    |  46 +++++---
drivers/staging/dgnc/digi.h        |  32 ++--- 8 files changed, 223
Quoted 2 lines

insertions(+), 143 deletions(-)

Hi Sanidhya,

Just to help you out since you're struggling some.

Subject line should be something like "Fix checkpatch warnings". Better yet would be a subject specifying what you fixed to silence checkpatch warnings. For example, "Fixed comments formatting" or "Removed unnecessary spaces"

And the commit message should not be vague like "Patch contains the spacing fixes that led to checkpatch.pl warnings." You should write what you did to fix the warnings.
For example: Fixed checkpatch warning *write warning here* by correcting *whatever change you did*

Regards,
Amitoj

maintainer
#24 lore raw
In reply to Sanidhya Solanki

Why is the "Re:" in the Subject?

Why is "Patch" in the subject"?

The Subject doesn't even make sense.

Quoted 8 lines · Sanidhya Solanki

Patch contains the spacing fixes that led to checkpatch.pl warnings.

---
 drivers/staging/dgnc/dgnc_cls.c    |   4 +-
 drivers/staging/dgnc/dgnc_driver.h |   8 --
 drivers/staging/dgnc/dgnc_neo.c    | 235

++++++++++++++++++++++++-------------

Patch is line-wrapped and doesn't even apply :(

Please take a day, relax, and fix up all 3 of these and resend them tomorrow. There's no rush here.

greg k-h