dgnc: Remove redundant blank lines in dgnc_cls.c
PATCH 1/1 dgnc: Remove redundant blank lines in dgnc_cls.c
There are a lot double of blank lines in dgnc_cls.c thus remove them to make the file follow the CodingStyle. Also, remove one blank line at the end of dgnc_cls.c.
--- drivers/staging/dgnc/dgnc_cls.c | 36 ------------------------------------ 1 file changed, 36 deletions(-)
drivers/staging/dgnc/dgnc_cls.c +0 -36
@@ -92,14 +92,12 @@ struct board_ops dgnc_cls_ops = { .send_immediate_char = cls_send_immediate_char }; -static inline void cls_set_cts_flow_control (struct channel_t *ch) {unsigned char lcrb =readb (&ch->ch_cls_uart->lcr);unsigned char ier =readb (&ch->ch_cls_uart->ier);unsigned char isr_fcr =0 ; -/* * The Enhanced Register Set may only be accessed when * the Line Control Register is set to 0xBFh.
@@ -136,14 +134,12 @@ static inline void cls_set_cts_flow_control(struct channel_t *ch) } -static inline void cls_set_ixon_flow_control (struct channel_t *ch) {unsigned char lcrb =readb (&ch->ch_cls_uart->lcr);unsigned char ier =readb (&ch->ch_cls_uart->ier);unsigned char isr_fcr =0 ; -/* * The Enhanced Register Set may only be accessed when * the Line Control Register is set to 0xBFh.
@@ -184,14 +180,12 @@ static inline void cls_set_ixon_flow_control(struct channel_t *ch) } -static inline void cls_set_no_output_flow_control (struct channel_t *ch) {unsigned char lcrb =readb (&ch->ch_cls_uart->lcr);unsigned char ier =readb (&ch->ch_cls_uart->ier);unsigned char isr_fcr =0 ; -/* * The Enhanced Register Set may only be accessed when * the Line Control Register is set to 0xBFh.
@@ -230,14 +224,12 @@ static inline void cls_set_no_output_flow_control(struct channel_t *ch) } -static inline void cls_set_rts_flow_control (struct channel_t *ch) {unsigned char lcrb =readb (&ch->ch_cls_uart->lcr);unsigned char ier =readb (&ch->ch_cls_uart->ier);unsigned char isr_fcr =0 ; -/* * The Enhanced Register Set may only be accessed when * the Line Control Register is set to 0xBFh.
@@ -266,20 +258,17 @@ static inline void cls_set_rts_flow_control(struct channel_t *ch) UART_16654_FCR_TXTRIGGER_16 | UART_FCR_CLEAR_RCVR), &ch->ch_cls_uart->isr_fcr); - ch->ch_r_watermark =4 ; ch->ch_r_tlevel =8 ; } -static inline void cls_set_ixoff_flow_control (struct channel_t *ch) {unsigned char lcrb =readb (&ch->ch_cls_uart->lcr);unsigned char ier =readb (&ch->ch_cls_uart->ier);unsigned char isr_fcr =0 ; -/* * The Enhanced Register Set may only be accessed when * the Line Control Register is set to 0xBFh.
@@ -316,14 +305,12 @@ static inline void cls_set_ixoff_flow_control(struct channel_t *ch) } -static inline void cls_set_no_input_flow_control (struct channel_t *ch) {unsigned char lcrb =readb (&ch->ch_cls_uart->lcr);unsigned char ier =readb (&ch->ch_cls_uart->ier);unsigned char isr_fcr =0 ; -/* * The Enhanced Register Set may only be accessed when * the Line Control Register is set to 0xBFh.
@@ -357,7 +344,6 @@ static inline void cls_set_no_input_flow_control(struct channel_t *ch) } -/* * cls_clear_break. * Determines whether its time to shut off break condition.
@@ -393,7 +379,6 @@ static inline void cls_clear_break(struct channel_t *ch, int force)spin_unlock_irqrestore (&ch->ch_lock, flags); } -/* Parse the ISR register for the specific port */ static inline void cls_parse_isr (struct dgnc_board *brd,uint port) {
@@ -457,7 +442,6 @@ static inline void cls_parse_isr(struct dgnc_board *brd, uint port) } } -/* * cls_param() * Send any/all changes to the line to the UART.
@@ -711,7 +695,6 @@ static void cls_param(struct tty_struct *tty)cls_parse_modem (ch,readb (&ch->ch_cls_uart->msr)); } -/* * Our board poller function. */
@@ -784,7 +767,6 @@ static void cls_tasklet(unsigned long data) } -/* * cls_intr() *
@@ -834,7 +816,6 @@ static irqreturn_t cls_intr(int irq, void *voidbrd)return IRQ_HANDLED ; } -static void cls_disable_receiver (struct channel_t *ch) {unsigned char tmp =readb (&ch->ch_cls_uart->ier);
@@ -843,7 +824,6 @@ static void cls_disable_receiver(struct channel_t *ch)writeb (tmp, &ch->ch_cls_uart->ier); } -static void cls_enable_receiver (struct channel_t *ch) {unsigned char tmp =readb (&ch->ch_cls_uart->ier);
@@ -852,7 +832,6 @@ static void cls_enable_receiver(struct channel_t *ch)writeb (tmp, &ch->ch_cls_uart->ier); } -static void cls_copy_data_from_uart_to_queue (struct channel_t *ch) {int qleft =0 ;
@@ -942,7 +921,6 @@ static void cls_copy_data_from_uart_to_queue(struct channel_t *ch)spin_unlock_irqrestore (&ch->ch_lock, flags); } -/* * This function basically goes to sleep for secs, or until * it gets signalled that the port has fully drained.
@@ -978,7 +956,6 @@ static int cls_drain(struct tty_struct *tty, uint seconds) ((un->un_flags & UN_EMPTY) == 0)); } -/* Channel lock MUST be held before calling this function! */ static void cls_flush_uart_write (struct channel_t *ch) {
@@ -992,7 +969,6 @@ static void cls_flush_uart_write(struct channel_t *ch) ch->ch_flags |= (CH_TX_FIFO_EMPTY |CH_TX_FIFO_LWM ); } -/* Channel lock MUST be held before calling this function! */ static void cls_flush_uart_read (struct channel_t *ch) {
@@ -1013,7 +989,6 @@ static void cls_flush_uart_read(struct channel_t *ch)udelay (10 ); } -static void cls_copy_data_from_queue_to_uart (struct channel_t *ch) {ushort head;
@@ -1097,7 +1072,6 @@ static void cls_copy_data_from_queue_to_uart(struct channel_t *ch)spin_unlock_irqrestore (&ch->ch_lock, flags); } -static void cls_parse_modem (struct channel_t *ch,unsigned char signals) {unsigned char msignals = signals;
@@ -1162,7 +1136,6 @@ static void cls_parse_modem(struct channel_t *ch, unsigned char signals)spin_unlock_irqrestore (&ch->ch_lock, flags); } -/* Make the UART raise any of the output signals we want up */ static void cls_assert_modem_signals (struct channel_t *ch) {
@@ -1182,7 +1155,6 @@ static void cls_assert_modem_signals(struct channel_t *ch)udelay (10 ); } -static void cls_send_start_character (struct channel_t *ch) {if (!ch || ch->magic !=DGNC_CHANNEL_MAGIC )
@@ -1194,7 +1166,6 @@ static void cls_send_start_character(struct channel_t *ch) } } -static void cls_send_stop_character (struct channel_t *ch) {if (!ch || ch->magic !=DGNC_CHANNEL_MAGIC )
@@ -1206,7 +1177,6 @@ static void cls_send_stop_character(struct channel_t *ch) } } -/* Inits UART */ static void cls_uart_init (struct channel_t *ch) {
@@ -1244,7 +1214,6 @@ static void cls_uart_init(struct channel_t *ch)readb (&ch->ch_cls_uart->msr); } -/* * Turns off UART. */
@@ -1253,7 +1222,6 @@ static void cls_uart_off(struct channel_t *ch)writeb (0 , &ch->ch_cls_uart->ier); } -/* * cls_get_uarts_bytes_left. * Returns 0 is nothing left in the FIFO, returns 1 otherwise.
@@ -1283,7 +1251,6 @@ static uint cls_get_uart_bytes_left(struct channel_t *ch)return left; } -/* * cls_send_break. * Starts sending a break thru the UART.
@@ -1326,7 +1293,6 @@ static void cls_send_break(struct channel_t *ch, int msecs) } } -/* * cls_send_immediate_char. * Sends a specific character as soon as possible to the UART,
@@ -1348,7 +1314,6 @@ static void cls_vpd(struct dgnc_board *brd)u8 __iomem *re_map_vpdbase;/* Remapped memory of the card */ int i =0 ; - vpdbase =pci_resource_start (brd->pdev,3 );/* No VPD */
@@ -1370,4 +1335,3 @@ static void cls_vpd(struct dgnc_board *brd)if (re_map_vpdbase)iounmap (re_map_vpdbase); } -
Signature · 1 line
2.3.2
PATCH 1/1 dgnc: Make all lines under 80 characters in dgnc_cls.h
Some of the lines are over 80 characters so fix that by moving the comments before the struct definition and before #define's.
--- drivers/staging/dgnc/dgnc_cls.h | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-)
drivers/staging/dgnc/dgnc_cls.h +28 -12
@@ -35,15 +35,25 @@* U = Unused. * ************************************************************************/ +/* +* txrx : WR RHR/THR - Holding reg +* ier : WR IER - Interrupt Enable Reg +* isr_fcr : WR ISR/FCR - Interrupt Status Reg/Fifo Control Reg +* lcr : WR LCR - Line Control Reg +* mcr : WR MCR - Modem Control Reg +* lsr : WR LSR - Line Status Reg +* msr : WR MSG - Modem Status Reg +* spr : WR SPR - Scratch pad Reg +*/ struct cls_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 lcr;/* WR LCR - Line Control Reg */ -u8 mcr;/* WR MCR - Modem Control Reg */ -u8 lsr;/* WR LSR - Line Status Reg */ -u8 msr;/* WR MSR - Modem Status Reg */ -u8 spr;/* WR SPR - Scratch Pad Reg */ +u8 txrx; +u8 ier; +u8 isr_fcr; +u8 lcr; +u8 mcr; +u8 lsr; +u8 msr; +u8 spr; };/* Where to read the interrupt register (8bits) */
@@ -61,8 +71,11 @@ struct cls_uart_struct {#define UART_16654_FCR_RXTRIGGER_56 0x80#define UART_16654_FCR_RXTRIGGER_60 0xC0 -#define UART_IIR_CTSRTS 0x20/* Received CTS/RTS change of state */ -#define UART_IIR_RDI_TIMEOUT 0x0C/* Receiver data TIMEOUT */ +/* Received CTS/RTS change of state */ +#define UART_IIR_CTSRTS 0x20 + +/* Receiver data TIMEOUT */ +#define UART_IIR_RDI_TIMEOUT 0x0C/* * These are the EXTENDED definitions for the Exar 654's Interrupt
@@ -74,8 +87,11 @@ struct cls_uart_struct {#define UART_EXAR654_EFR_RTSDTR 0x40/* Auto RTS/DTR Flow Control Enable */ #define UART_EXAR654_EFR_CTSDSR 0x80/* Auto CTS/DSR Flow COntrol Enable */ -#define UART_EXAR654_XOFF_DETECT 0x1/* Indicates whether chip saw an incoming XOFF char */ -#define UART_EXAR654_XON_DETECT 0x2/* Indicates whether chip saw an incoming XON char */ +/* Indicates whether chip saw an incoming XOFF char */ +#define UART_EXAR654_XOFF_DETECT 0x1 + +/* Indicates whether chip saw an incoming XON char */ +#define UART_EXAR654_XON_DETECT 0x2#define UART_EXAR654_IER_XOFF 0x20/* Xoff Interrupt Enable */ #define UART_EXAR654_IER_RTSDTR 0x40/* Output Interrupt Enable */
Signature · 1 line
2.3.2
PATCH 1/1 dgnc: Make all lines under 80 characters in dgnc_driver.c
In reply to Giedrius StatkevičiusSome of the lines are over 80 characters in dgnc_driver.c so fix them by moving the comments closer to the code, tidying the comments to make them smaller, and remove a redundant space after +.
--- drivers/staging/dgnc/dgnc_driver.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/staging/dgnc/dgnc_driver.c +8 -7
@@ -60,7 +60,8 @@ static void dgnc_init_globals(void);static int dgnc_found_board (struct pci_dev *pdev,int id);static void dgnc_cleanup_board (struct dgnc_board *brd);static void dgnc_poll_handler (ulong dummy); -static int dgnc_init_one (struct pci_dev *pdev,const struct pci_device_id *ent); +static int dgnc_init_one (struct pci_dev *pdev, +const struct pci_device_id *ent);static void dgnc_do_remap (struct dgnc_board *brd);/*
@@ -92,8 +93,8 @@ static struct class *dgnc_class;* Poller stuff */ static DEFINE_SPINLOCK (dgnc_poll_lock);/* Poll scheduling lock */ -static ulong dgnc_poll_time;/* Time of next poll */ -static uint dgnc_poll_stop;/* Used to tell poller to stop */ +static ulong dgnc_poll_time;/* Time of next poll */ +static uint dgnc_poll_stop;/* Used to tell poller to stop */ static struct timer_list dgnc_poll_timer;
@@ -214,7 +215,7 @@ static int __init dgnc_init_module(void)* If something went wrong in the scan, bail out of driver. */ if (rc <0 ) { -/* Only unregister the pci driver if it was actually registered. */ +/* Only unregister if it was actually registered. */ if (dgnc_NumBoards)pci_unregister_driver (&dgnc_driver);else
@@ -551,7 +552,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)if (brd->re_map_membase) { -/* After remap is complete, we need to read and store the dvid */ +/* Read and store the dvid after remapping */ brd->dvid =readb (brd->re_map_membase +0x8D );/* Get and store the board VPD, if it exists */
@@ -708,7 +709,7 @@ static void dgnc_poll_handler(ulong dummy)spin_lock_irqsave (&brd->bd_lock, flags); -/* If board is in a failed state, don't bother scheduling a tasklet */ +/* If board is in a failed state don't schedule a tasklet */ if (brd->state ==BOARD_FAILED ) {spin_unlock_irqrestore (&brd->bd_lock, flags);continue ;
@@ -729,7 +730,7 @@ static void dgnc_poll_handler(ulong dummy) new_time = dgnc_poll_time - jiffies;if ((ulong ) new_time >=2 * dgnc_poll_tick) - dgnc_poll_time = jiffies +dgnc_jiffies_from_ms (dgnc_poll_tick); + dgnc_poll_time = jiffies +dgnc_jiffies_from_ms (dgnc_poll_tick);setup_timer (&dgnc_poll_timer, dgnc_poll_handler,0 ); dgnc_poll_timer.expires = dgnc_poll_time;
Signature · 1 line
2.3.2
PATCH 4/4 dgnc: Make all lines under 80 characters in dgnc_driver.h
In reply to Giedrius StatkevičiusFix comments to make lines less than 80 characters by moving them, breaking the lines or making them neater.
--- drivers/staging/dgnc/dgnc_driver.h | 55 +++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 19 deletions(-)
drivers/staging/dgnc/dgnc_driver.h +36 -19
@@ -31,7 +31,7 @@#include <linux/tty.h> /* To pick up the various tty structs/defines */ #include <linux/interrupt.h> /* For irqreturn_t type */ -#include "dgnc_types.h" /* Additional types needed by the Digi header files */ +#include "dgnc_types.h" /* Additional types needed by the Digi header files */ #include "digi.h" /* Digi specific ioctl header */ #include "dgnc_kcompat.h" /* Kernel 2.4/2.6 compat includes */ #include "dgnc_sysfs.h" /* Support for SYSFS */
@@ -68,7 +68,10 @@#define PORT_NUM (dev) ((dev) & 0x7f)#define IS_PRINT (dev) (((dev) & 0xff) >= 0x80) -/* MAX number of stop characters we will send when our read queue is getting full */ +/* +* MAX number of stop characters we will send +* when our read queue is getting full +*/ #define MAX_STOPS_SENT 5/* 4 extra for alignment play space */
@@ -170,15 +173,20 @@ struct dgnc_board {unsigned char rev;/* PCI revision ID */ uint pci_bus;/* PCI bus value */ uint pci_slot;/* PCI slot value */ -uint maxports;/* MAX ports this board can handle */ +uint maxports;/* +* MAX ports this board +* can handle +*/ unsigned char dvid;/* Board specific device id */ unsigned char vpd[128 ];/* VPD of board, if found */ unsigned char serial_num[20 ];/* Serial number of board, if found in VPD */ spinlock_t bd_lock;/* Used to protect board */ -spinlock_t bd_intr_lock;/* Used to protect the poller tasklet and -* the interrupt routine from each other. +spinlock_t bd_intr_lock;/* +* Used to protect the poller tasklet +* and the interrupt routine from +* each other. */ uint state;/* State of card. */
@@ -197,14 +205,14 @@ struct dgnc_board {ulong membase;/* Start of base memory of the card */ ulong membase_end;/* End of base memory of the card */ -u8 __iomem *re_map_membase;/* Remapped memory of the card */ +u8 __iomem *re_map_membase;/* Remapped memory of the card */ ulong iobase;/* Start of io base of the card */ ulong iobase_end;/* End of io base of the card */ uint bd_uart_offset;/* Space between each UART */ -struct channel_t *channels[MAXPORTS ];/* array of pointers to our channels. */ +struct channel_t *channels[MAXPORTS ];/* Pointers to channels */ struct tty_driver SerialDriver;char SerialName[200 ];
@@ -219,10 +227,10 @@ struct dgnc_board {uint TtyRefCnt; -char *flipbuf;/* Our flip buffer, alloced if board is found */ +char *flipbuf;/* Our flip buffer, alloced if board is found */ -u16 dpatype;/* The board "type", as defined by DPA */ -u16 dpastatus;/* The board "status", as defined by DPA */ +u16 dpatype;/* The board "type", as defined by DPA */ +u16 dpastatus;/* The board "status", as defined by DPA */ /* * Mgmt data.
@@ -315,7 +323,7 @@ struct un_t {************************************************************************/ struct channel_t {int magic;/* Channel Magic Number */ -struct dgnc_board *ch_bd;/* Board structure pointer */ +struct dgnc_board *ch_bd;/* Board structure pointer */ struct digi_t ch_digi;/* Transparent Print structure */ struct un_t ch_tun;/* Terminal unit info */ struct un_t ch_pun;/* Printer unit info */
@@ -327,7 +335,10 @@ struct channel_t {uint ch_open_count;/* open count */ uint ch_flags;/* Channel flags */ -ulong ch_close_delay;/* How long we should drop RTS/DTR for */ +ulong ch_close_delay;/* +* How long we should drop +* RTS/DTR for +*/ ulong ch_cpstime;/* Time for CPS calculations */
@@ -343,11 +354,11 @@ struct channel_t {uint ch_wopen;/* Waiting for open process cnt */ -unsigned char ch_mostat;/* FEP output modem status */ -unsigned char ch_mistat;/* FEP input modem status */ +unsigned char ch_mostat;/* FEP output modem status */ +unsigned char ch_mistat;/* FEP input modem status */ -struct neo_uart_struct __iomem *ch_neo_uart;/* Pointer to the "mapped" UART struct */ -struct cls_uart_struct __iomem *ch_cls_uart;/* Pointer to the "mapped" UART struct */ +struct neo_uart_struct __iomem *ch_neo_uart;/* Pointer to the "mapped" UART struct */ +struct cls_uart_struct __iomem *ch_cls_uart;/* Pointer to the "mapped" UART struct */ unsigned char ch_cached_lsr;/* Cached value of the LSR register */
@@ -371,9 +382,12 @@ struct channel_t {unsigned char ch_r_watermark;/* Receive Watermark */ -ulong ch_stop_sending_break;/* Time we should STOP sending a break */ +ulong ch_stop_sending_break;/* +* Time we should STOP +* sending a break +*/ -uint ch_stops_sent;/* How many times I have sent a stop character +uint ch_stops_sent;/* How many times I have sent a stop char * to try to stop the other guy sending. */ ulong ch_err_parity;/* Count of parity errors on channel */
@@ -402,7 +416,10 @@ 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 uint dgnc_NumBoards;/* Total number of boards */ -extern struct dgnc_board *dgnc_Board[MAXBOARDS ];/* Array of board structs */ +extern struct dgnc_board *dgnc_Board[MAXBOARDS ];/* +* Array of board +* structs +*/ extern char *dgnc_state_text[];/* Array of state text */ #endif
Signature · 1 line
2.3.2
Re: [PATCH 4/4] dgnc: Make all lines under 80 characters in dgnc_driver.h
This one is bad. I've accidentally sent it, sorry. Don't pull/review this.
Quoted 3 lines · Giedrius Statkevičius
Fix comments to make lines less than 80 characters by moving them, breaking the lines or making them neater.
[...]
Signature · 2 lines
Thanks, Giedrius