staging: dgnc: Break line after boolean operator
PATCH 1/1 staging: dgnc: Break line after boolean operator
The preferred way to break up long math lines is to break after an arthimetic or boolean operator.
This patch fixes the checkpatch.pl warning:
Logical continuations should be on the previous line.
--- drivers/staging/dgnc/dgnc_neo.c | 12 +++++++----- drivers/staging/dgnc/dgnc_tty.c | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-)
drivers/staging/dgnc/dgnc_neo.c +7 -5
@@ -351,8 +351,8 @@ 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) { +if (time_after_eq (jiffies, ch->ch_stop_sending_break) || + force) {unsigned char temp =readb (&ch->ch_neo_uart->lcr);writeb ((temp & ~UART_LCR_SBC ), &ch->ch_neo_uart->lcr);
@@ -1783,9 +1783,11 @@ static void neo_vpd(struct dgnc_board *brd) 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[0x7F ] !=0x78 )) {/* small resource end tag */ +if (((brd->vpd[0x08 ] !=0x82 ) &&/* long resource name tag */ + (brd->vpd[0x10 ] !=0x82 )) ||/* long resource name tag +* (PCI-66 files) +*/ + (brd->vpd[0x7F ] !=0x78 )) {/* small resource end tag */ memset (brd->vpd,'\0' ,NEO_VPD_IMAGESIZE ); }else {
drivers/staging/dgnc/dgnc_tty.c +2 -2
@@ -1800,8 +1800,8 @@ static int dgnc_tty_write(struct tty_struct *tty, }/* Update printer buffer empty time. */ -if ((un->un_type ==DGNC_PRINT ) && (ch->ch_digi.digi_maxcps >0 ) - && (ch->ch_digi.digi_bufsize >0 )) { +if ((un->un_type ==DGNC_PRINT ) && (ch->ch_digi.digi_maxcps >0 ) && + (ch->ch_digi.digi_bufsize >0 )) { ch->ch_cpstime += (HZ * count) / ch->ch_digi.digi_maxcps; }
Signature · 1 line
2.1.4
Quoted 16 lines · Rehas Sachdeva
The preferred way to break up long math lines is to break after an arthimetic or boolean operator.
This patch fixes the checkpatch.pl warning:
Logical continuations should be on the previous line.Signed-off-by Rehas Sachdeva <[email protected]>--- drivers/staging/dgnc/dgnc_neo.c | 12 +++++++----- drivers/staging/dgnc/dgnc_tty.c | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-)drivers/staging/dgnc/dgnc_neo.c +0
-0
drivers/staging/dgnc/dgnc_neo.c static inline void neo_clear_break(struct channel_t *ch, int force) · line 355
Quoted 7 lines
drivers/staging/dgnc/dgnc_neo.c +2
-2@@ -351,8 +351,8 @@ 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) { +if (time_after_eq (jiffies, ch->ch_stop_sending_break) || + force) {
Actually, this doesn't look so nice to me, probably because force is so short.
Quoted 5 lines
drivers/staging/dgnc/dgnc_neo.c +0
-0unsigned char temp =readb (&ch->ch_neo_uart->lcr);writeb ((temp & ~UART_LCR_SBC ), &ch->ch_neo_uart->lcr);@@ -1783,9 +1783,11 @@ static void neo_vpd(struct dgnc_board *brd) brd->vpd[(i *2 ) +1 ] = (a >>8 ) &0xff ;
drivers/staging/dgnc/dgnc_neo.c static void neo_vpd(struct dgnc_board *brd) · line 1790
Quoted 10 lines
drivers/staging/dgnc/dgnc_neo.c +5
-3} -if (((brd->vpd[0x08 ] !=0x82 )/* long resource name tag */ - && (brd->vpd[0x10 ] !=0x82 ))/* long resource name tag (PCI-66 files)*/ - || (brd->vpd[0x7F ] !=0x78 )) {/* small resource end tag */ +if (((brd->vpd[0x08 ] !=0x82 ) &&/* long resource name tag */ + (brd->vpd[0x10 ] !=0x82 )) ||/* long resource name tag +* (PCI-66 files) +*/ + (brd->vpd[0x7F ] !=0x78 )) {/* small resource end tag */
This one doesn't either. Maybe there could be a single line comment, above the tested expression.
Quoted 8 lines
drivers/staging/dgnc/dgnc_neo.c +0
-0memset (brd->vpd,'\0' ,NEO_VPD_IMAGESIZE ); }else {drivers/staging/dgnc/dgnc_tty.c +0
-0
drivers/staging/dgnc/dgnc_tty.c static int dgnc_tty_write(struct tty_struct *tty, · line 1805
Quoted 8 lines
drivers/staging/dgnc/dgnc_tty.c +2
-2@@ -1800,8 +1800,8 @@ static int dgnc_tty_write(struct tty_struct *tty, }/* Update printer buffer empty time. */ -if ((un->un_type ==DGNC_PRINT ) && (ch->ch_digi.digi_maxcps >0 ) - && (ch->ch_digi.digi_bufsize >0 )) { +if ((un->un_type ==DGNC_PRINT ) && (ch->ch_digi.digi_maxcps >0 ) && + (ch->ch_digi.digi_bufsize >0 )) { ch->ch_cpstime += (HZ * count) / ch->ch_digi.digi_maxcps;
This one looks fine.
julia
Quoted 12 lines
drivers/staging/dgnc/dgnc_tty.c +0
-0}Signature · 8 lines
2.1.4 -- 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/20160225204443.GA29868%40Toblerone. For more options, visit https://groups.google.com/d/optout.