staging: dgnc: fixes multiple coding style issues
cover staging: dgnc: fixes multiple coding style issues
This patch aims to fix multiple checkpatch.pl issues and warnings in dgnc driver, mostly on dgnc_driver.h and dgnc_tty.c files.
Juliana Rodrigues (8):
staging: dgnc: renamed SerialDriver to avoid camelcase
staging: dgnc: renamed SerialName to avoid camelcase
staging: dgnc: fixed multiple line over 80 characters warning
staging: dgnc: renames PrintName variable to avoid camelcase
staging: dgnc: renames PrintDriver variable to avoid camelcase
staging: dgnc: renames dgnc_Serial_Major variable to avoid camelcase
staging: dgnc: renames dgnc variable to avoid camelcase
staging: dgnc: renames TtyRefCnt variable to avoid camelcase
drivers/staging/dgnc/dgnc_driver.h | 14 ++-- drivers/staging/dgnc/dgnc_tty.c | 151 +++++++++++++++++++------------------ 2 files changed, 86 insertions(+), 79 deletions(-)
Signature · 1 line
2.7.2
PATCH 1/8 staging: dgnc: renamed SerialDriver to avoid camelcase
This patch renames SerialDriver variable indgnc_driver.h and its calls in dgnc_tty.c
that were causing CamelCase checkpatch issues.
CHECK: Avoid CamelCase: <SerialDriver>
+ struct tty_driver SerialDriver;
--- drivers/staging/dgnc/dgnc_driver.h | 2 +- drivers/staging/dgnc/dgnc_tty.c | 62 +++++++++++++++++++------------------- 2 files changed, 32 insertions(+), 32 deletions(-)
drivers/staging/dgnc/dgnc_driver.h +1 -1
@@ -205,7 +205,7 @@ struct dgnc_board {* to our channels. */ -struct tty_driver SerialDriver; +struct tty_driver serial_driver;char SerialName[200 ];struct tty_driver PrintDriver;char PrintName[200 ];
drivers/staging/dgnc/dgnc_tty.c +31 -31
126 lines not on this page · raw message
Signature · 1 line
2.7.2
PATCH 2/8 staging: dgnc: renamed SerialName to avoid camelcase
In reply to Juliana RodriguesThis patch renames SerialName variable in dgnc_driver.h and its calls in dgnc_tty.c in order to avoid checkpatch issues.
CHECK: Avoid CamelCase: <SerialName>
+ char SerialName[200];
--- drivers/staging/dgnc/dgnc_driver.h | 2 +- drivers/staging/dgnc/dgnc_tty.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/dgnc/dgnc_driver.h +1 -1
@@ -206,7 +206,7 @@ struct dgnc_board {*/ struct tty_driver serial_driver; -char SerialName[200 ]; +char serial_name[200 ];struct tty_driver PrintDriver;char PrintName[200 ];
drivers/staging/dgnc/dgnc_tty.c +2 -2
@@ -180,9 +180,9 @@ int dgnc_tty_register(struct dgnc_board *brd) brd->serial_driver.magic =TTY_DRIVER_MAGIC ; -snprintf (brd->SerialName,MAXTTYNAMELEN ,"tty_dgnc_%d_" , brd->boardnum); +snprintf (brd->serial_name,MAXTTYNAMELEN ,"tty_dgnc_%d_" , brd->boardnum); - brd->serial_driver.name = brd->SerialName; + brd->serial_driver.name = brd->serial_name; brd->serial_driver.name_base =0 ; brd->serial_driver.major =0 ; brd->serial_driver.minor_start =0 ;
Signature · 1 line
2.7.2
PATCH 3/8 staging: dgnc: fixed multiple line over 80 characters warning
In reply to Juliana RodriguesThis patch fixes formatting for multiple lines that caused checkpatch.pl warnings.
--- drivers/staging/dgnc/dgnc_tty.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
drivers/staging/dgnc/dgnc_tty.c +14 -7
@@ -180,7 +180,8 @@ int dgnc_tty_register(struct dgnc_board *brd) brd->serial_driver.magic =TTY_DRIVER_MAGIC ; -snprintf (brd->serial_name,MAXTTYNAMELEN ,"tty_dgnc_%d_" , brd->boardnum); +snprintf (brd->serial_name,MAXTTYNAMELEN ,"tty_dgnc_%d_" , + brd->boardnum); brd->serial_driver.name = brd->serial_name; brd->serial_driver.name_base =0 ;
@@ -936,7 +937,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); }
@@ -957,7 +959,8 @@ void dgnc_wakeup_writes(struct channel_t *ch)*/ if (ch->ch_digi.digi_flags &DIGI_RTS_TOGGLE ) { ch->ch_mostat &= ~(UART_MCR_RTS ); - ch->ch_bd->bd_ops->assert_modem_signals (ch); + ch->ch_bd->bd_ops-> +assert_modem_signals (ch); }/*
@@ -966,7 +969,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 +982,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); }
@@ -2720,13 +2725,15 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,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); +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 ); -wake_up_interruptible (&ch->ch_pun.un_flags_wait); +wake_up_interruptible (&ch-> + ch_pun.un_flags_wait); } } }
Signature · 1 line
2.7.2
PATCH 4/8 staging: dgnc: renames PrintName variable to avoid camelcase
In reply to Juliana RodriguesThis patch fixes a checkpatch issue by
renaming PrintName variable to print_name,
avoiding camelcase.
CHECK: Avoid CamelCase: <PrintName>
+ char PrintName[200];
--- drivers/staging/dgnc/dgnc_driver.h | 2 +- drivers/staging/dgnc/dgnc_tty.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/dgnc/dgnc_driver.h +1 -1
@@ -208,7 +208,7 @@ struct dgnc_board {struct tty_driver serial_driver;char serial_name[200 ];struct tty_driver PrintDriver; -char PrintName[200 ]; +char print_name[200 ];bool dgnc_Major_Serial_Registered;bool dgnc_Major_TransparentPrint_Registered;
drivers/staging/dgnc/dgnc_tty.c +2 -2
@@ -236,9 +236,9 @@ int dgnc_tty_register(struct dgnc_board *brd)* we are when we get into the dgnc_tty_open() routine. */ brd->PrintDriver.magic =TTY_DRIVER_MAGIC ; -snprintf (brd->PrintName,MAXTTYNAMELEN ,"pr_dgnc_%d_" , brd->boardnum); +snprintf (brd->print_name,MAXTTYNAMELEN ,"pr_dgnc_%d_" , brd->boardnum); - brd->PrintDriver.name = brd->PrintName; + brd->PrintDriver.name = brd->print_name; brd->PrintDriver.name_base =0 ; brd->PrintDriver.major = brd->serial_driver.major; brd->PrintDriver.minor_start =0x80 ;
Signature · 1 line
2.7.2
PATCH 5/8 staging: dgnc: renames PrintDriver variable to avoid camelcase
In reply to Juliana RodriguesThis patch fixes checkpatch issues by renaming
PrintDriver variable to avoid camelcase.
CHECK: Avoid CamelCase: <PrintDriver>
+ struct tty_driver PrintDriver;
--- drivers/staging/dgnc/dgnc_driver.h | 2 +- drivers/staging/dgnc/dgnc_tty.c | 58 +++++++++++++++++++------------------- 2 files changed, 30 insertions(+), 30 deletions(-)
drivers/staging/dgnc/dgnc_driver.h +1 -1
@@ -207,7 +207,7 @@ struct dgnc_board {struct tty_driver serial_driver;char serial_name[200 ]; -struct tty_driver PrintDriver; +struct tty_driver print_driver;char print_name[200 ];bool dgnc_Major_Serial_Registered;
drivers/staging/dgnc/dgnc_tty.c +29 -29
114 lines not on this page · raw message
Signature · 1 line
2.7.2
PATCH 6/8 staging: dgnc: renames dgnc_Serial_Major variable to avoid camelcase
In reply to Juliana RodriguesThis patch renames dgnc_Serial_Major variable
in order to fix a camelcase checkpatch issue:
CHECK: Avoid CamelCase: <dgnc_Serial_Major>
+ uint dgnc_Serial_Major;
--- drivers/staging/dgnc/dgnc_driver.h | 2 +- drivers/staging/dgnc/dgnc_tty.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/dgnc/dgnc_driver.h +1 -1
@@ -213,7 +213,7 @@ struct dgnc_board {bool dgnc_Major_Serial_Registered;bool dgnc_Major_TransparentPrint_Registered; -uint dgnc_Serial_Major; +uint dgnc_serial_major;uint dgnc_TransparentPrint_Major;uint TtyRefCnt;
drivers/staging/dgnc/dgnc_tty.c +2 -2
@@ -287,7 +287,7 @@ int dgnc_tty_register(struct dgnc_board *brd) } dgnc_BoardsByMajor[brd->serial_driver.major] = brd; - brd->dgnc_Serial_Major = brd->serial_driver.major; + brd->dgnc_serial_major = brd->serial_driver.major; brd->dgnc_TransparentPrint_Major = brd->print_driver.major;return rc;
@@ -410,7 +410,7 @@ void dgnc_tty_uninit(struct dgnc_board *brd)if (brd->dgnc_Major_Serial_Registered) { dgnc_BoardsByMajor[brd->serial_driver.major] =NULL ; - brd->dgnc_Serial_Major =0 ; + brd->dgnc_serial_major =0 ;for (i =0 ; i < brd->nasync; i++) {if (brd->channels[i]) dgnc_remove_tty_sysfs(brd->channels[i]->
Signature · 1 line
2.7.2
PATCH 7/8 staging: dgnc: renames dgnc variable to avoid camelcase
In reply to Juliana RodriguesThis patch renames dgnc_TransparentPrint_Major todgnc_transparent_print_major in order to avoid
camelcase checkpatch issues:
CHECK: Avoid CamelCase: <dgnc_TransparentPrint_Major>
+ uint dgnc_TransparentPrint_Major;
--- drivers/staging/dgnc/dgnc_driver.h | 2 +- drivers/staging/dgnc/dgnc_tty.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/dgnc/dgnc_driver.h +1 -1
@@ -214,7 +214,7 @@ struct dgnc_board {bool dgnc_Major_TransparentPrint_Registered;uint dgnc_serial_major; -uint dgnc_TransparentPrint_Major; +uint dgnc_transparent_print_major;uint TtyRefCnt;
drivers/staging/dgnc/dgnc_tty.c +2 -2
@@ -288,7 +288,7 @@ int dgnc_tty_register(struct dgnc_board *brd) dgnc_BoardsByMajor[brd->serial_driver.major] = brd; brd->dgnc_serial_major = brd->serial_driver.major; - brd->dgnc_TransparentPrint_Major = brd->print_driver.major; + brd->dgnc_transparent_print_major = brd->print_driver.major;return rc; }
@@ -423,7 +423,7 @@ void dgnc_tty_uninit(struct dgnc_board *brd)if (brd->dgnc_Major_TransparentPrint_Registered) { dgnc_BoardsByMajor[brd->print_driver.major] =NULL ; - brd->dgnc_TransparentPrint_Major =0 ; + brd->dgnc_transparent_print_major =0 ;for (i =0 ; i < brd->nasync; i++) {if (brd->channels[i]) dgnc_remove_tty_sysfs(brd->channels[i]->
Signature · 1 line
2.7.2
PATCH 8/8 staging: dgnc: renames TtyRefCnt variable to avoid camelcase
In reply to Juliana RodriguesThis patch renames TtyRefCnt variable in dgnc_driver.h in order to fix a camelcase checkpatch issue:
HECK: Avoid CamelCase: <TtyRefCnt>
+ uint TtyRefCnt;
--- drivers/staging/dgnc/dgnc_driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/dgnc/dgnc_driver.h +1 -1
@@ -216,7 +216,7 @@ struct dgnc_board {uint dgnc_serial_major;uint dgnc_transparent_print_major; -uint TtyRefCnt; +uint tty_ref_cnt;u16 dpatype;/* The board "type", * as defined by DPA
Signature · 1 line
2.7.2
Re: [Outreachy kernel] [PATCH 8/8] staging: dgnc: renames TtyRefCnt variable to avoid camelcase
Quoted 4 lines · Juliana Rodrigues
This patch renames TtyRefCnt variable in
dgnc_driver.hin order to fix a camelcase checkpatch issue:HECK: Avoid CamelCase: <TtyRefCnt>
The C disappeared.
julia
Quoted 30 lines
+ uint TtyRefCnt;
Signed-off-by Juliana Rodrigues <[email protected]>--- drivers/staging/dgnc/dgnc_driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/dgnc/dgnc_driver.h +1
-1@@ -216,7 +216,7 @@ struct dgnc_board {uint dgnc_serial_major;uint dgnc_transparent_print_major; -uint TtyRefCnt; +uint tty_ref_cnt;u16 dpatype;/* The board "type", * as defined by DPA Signature · 8 lines
2.7.2 -- You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/64e3b81be7b8fd1ffcc9bfe1b565972a7dabc018.1457888423.git.juliana.orod%40gmail.com. For more options, visit https://groups.google.com/d/optout.