Fix checkpatch errors in drivers/isdn/isdnloop
Subsystems (2)
cover Fix checkpatch errors in drivers/isdn/isdnloop
This patchset adresses various checkpatch errors in the abovementioned driver.
Bas Peters (3):
drivers: isdn: isdnloop: isdnloop.c: remove assignment of variables in
if conditions, in accordance with the CodingStyle.
drivers: isdn: isdnloop: isdnloop.c: Fix brace positions according to
CodingStyle specifications.
drivers: isdn: isdnloop: isdnloop.c: Remove parenthesis around return
values, as specified in CodingStyle.
drivers/isdn/isdnloop/isdnloop.c | 64 +++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 34 deletions(-)
Signature · 1 line
2.1.0
PATCH 1/3 drivers: isdn: isdnloop: isdnloop.c: remove assignment of variables in if conditions, in accordance with the CodingStyle.
--- drivers/isdn/isdnloop/isdnloop.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/isdn/isdnloop/isdnloop.c +10 -8
@@ -59,7 +59,8 @@ isdnloop_bchan_send(isdnloop_card *card, int ch)isdn_ctrl cmd;while (card->sndcount[ch]) { -if ((skb =skb_dequeue (&card->bqueue[ch]))) { + skb =skb_dequeue (&card->bqueue[ch]); +if (skb) { len = skb->len; card->sndcount[ch] -= len; ack = *(skb->head);/* used as scratch area */
@@ -317,7 +318,8 @@ isdnloop_polldchan(unsigned long data)u_char *p;isdn_ctrl cmd; -if ((skb =skb_dequeue (&card->dqueue))) + skb =skb_dequeue (&card->dqueue); +if (skb) avail = skb->len;else avail =0 ;
@@ -471,8 +473,8 @@ isdnloop_fake(isdnloop_card *card, char *s, int ch) {struct sk_buff *skb;int len =strlen (s) + ((ch >=0 ) ?3 :0 ); - -if (!(skb =dev_alloc_skb (len))) { + skb =dev_alloc_skb (len); +if (!skb) {printk (KERN_WARNING "isdnloop: Out of memory in isdnloop_fake\n" );return 1 ; }
@@ -1439,8 +1441,8 @@ isdnloop_initcard(char *id) {isdnloop_card *card;int i; - -if (!(card =kzalloc (sizeof (isdnloop_card),GFP_KERNEL ))) { + card =kzalloc (sizeof (isdnloop_card),GFP_KERNEL ); +if (!card) {printk (KERN_WARNING "isdnloop: (%s) Could not allocate card-struct.\n" , id);return (isdnloop_card *)0 ;
@@ -1489,8 +1491,8 @@ static int isdnloop_addcard(char *id1) {isdnloop_card *card; - -if (!(card =isdnloop_initcard (id1))) { + card =isdnloop_initcard (id1); +if (!card) {return -EIO ; } printk(KERN_INFO
Signature · 1 line
2.1.0
PATCH 2/3 drivers: isdn: isdnloop: isdnloop.c: Fix brace positions according to CodingStyle specifications.
In reply to Bas Peters--- drivers/isdn/isdnloop/isdnloop.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-)
drivers/isdn/isdnloop/isdnloop.c +6 -12
@@ -150,8 +150,7 @@ typedef struct isdnloop_stat {int action; } isdnloop_stat;/* *INDENT-OFF* */ -static isdnloop_stat isdnloop_stat_table[] = -{ +static isdnloop_stat isdnloop_stat_table[] = { {"BCON_" ,ISDN_STAT_BCONN ,1 },/* B-Channel connected */ {"BDIS_" ,ISDN_STAT_BHUP ,2 },/* B-Channel disconnected */ {"DCON_" ,ISDN_STAT_DCONN ,0 },/* D-Channel connected */
@@ -485,8 +484,7 @@ isdnloop_fake(isdnloop_card *card, char *s, int ch)return 0 ; }/* *INDENT-OFF* */ -static isdnloop_stat isdnloop_cmd_table[] = -{ +static isdnloop_stat isdnloop_cmd_table[] = { {"BCON_R" ,0 ,1 },/* B-Channel connect */ {"BCON_I" ,0 ,17 },/* B-Channel connect ind */ {"BDIS_R" ,0 ,2 },/* B-Channel disconnect */
@@ -527,10 +525,8 @@ isdnloop_fake_err(isdnloop_card *card)isdnloop_fake (card,"NAK" ,-1 ); } -static u_char ctable_eu[] = -{0x00 ,0x11 ,0x01 ,0x12 }; -static u_char ctable_1t[] = -{0x00 ,0x3b ,0x01 ,0x3a }; +static u_char ctable_eu[] = {0x00 ,0x11 ,0x01 ,0x12 }; +static u_char ctable_1t[] = {0x00 ,0x3b ,0x01 ,0x3a };/* * Assemble a simplified cause message depending on the
@@ -649,10 +645,8 @@ isdnloop_kill_ctimer(isdnloop_card *card, int ch)spin_unlock_irqrestore (&card->isdnloop_lock, flags); } -static u_char si2bit[] = -{0 ,1 ,0 ,0 ,0 ,2 ,0 ,4 ,0 ,0 }; -static u_char bit2si[] = -{1 ,5 ,7 }; +static u_char si2bit[] = {0 ,1 ,0 ,0 ,0 ,2 ,0 ,4 ,0 ,0 }; +static u_char bit2si[] = {1 ,5 ,7 };/* * Try finding a listener for an outgoing call.
Signature · 1 line
2.1.0
PATCH 3/3 drivers: isdn: isdnloop: isdnloop.c: Remove parenthesis around return values, as specified in CodingStyle.
In reply to Bas Peters--- drivers/isdn/isdnloop/isdnloop.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
drivers/isdn/isdnloop/isdnloop.c +14 -14
@@ -552,9 +552,9 @@ isdnloop_unicause(isdnloop_card *card, int loc, int cau)sprintf (buf,"%02X44" , ctable_1t[cau]);break ;default : -return ("0000" ); +return "0000" ; } -return (buf); +return buf; }/*
@@ -750,17 +750,17 @@ isdnloop_vstphone(isdnloop_card *card, char *phone, int caller)if (caller) {for (i =0 ; i <2 ; i++)if (!(strcmp (card->s0num[i], phone))) -return (phone); -return (card->s0num[0 ]); +return phone; +return card->s0num[0 ]; } -return (phone); +return phone;break ;case ISDN_PTYPE_1TR6 :if (caller) {sprintf (nphone,"%s%c" , card->s0num[0 ], phone[0 ]); -return (nphone); +return nphone; }else -return (&phone[strlen (phone) -1 ]); +return &phone[strlen (phone) -1 ];break ; }return "" ;
@@ -1144,14 +1144,14 @@ isdnloop_command(isdn_ctrl *c, isdnloop_card *card)case ISDNLOOP_IOCTL_STARTUP :if (!access_ok (VERIFY_READ , (void *) a,sizeof (isdnloop_sdef)))return -EFAULT ; -return (isdnloop_start (card, (isdnloop_sdef *) a)); +return isdnloop_start (card, (isdnloop_sdef *) a);break ;case ISDNLOOP_IOCTL_ADDCARD :if (copy_from_user ((char *)&cdef, (char *)a,sizeof (cdef)))return -EFAULT ; -return (isdnloop_addcard (cdef.id1)); +return isdnloop_addcard (cdef.id1);break ;case ISDNLOOP_IOCTL_LEASEDCFG :if (a) {
@@ -1373,7 +1373,7 @@ if_command(isdn_ctrl *c)isdnloop_card *card =isdnloop_findcard (c->driver);if (card) -return (isdnloop_command (c, card)); +return isdnloop_command (c, card);printk (KERN_ERR "isdnloop: if_command called with invalid driverId!\n" );return -ENODEV ;
@@ -1387,7 +1387,7 @@ if_writecmd(const u_char __user *buf, int len, int id, int channel)if (card) {if (!(card->flags &ISDNLOOP_FLAGS_RUNNING ))return -ENODEV ; -return (isdnloop_writecmd (buf, len,1 , card)); +return isdnloop_writecmd (buf, len,1 , card); }printk (KERN_ERR "isdnloop: if_writecmd called with invalid driverId!\n" );
@@ -1402,7 +1402,7 @@ if_readstatus(u_char __user *buf, int len, int id, int channel)if (card) {if (!(card->flags &ISDNLOOP_FLAGS_RUNNING ))return -ENODEV ; -return (isdnloop_readstatus (buf, len, card)); +return isdnloop_readstatus (buf, len, card); }printk (KERN_ERR "isdnloop: if_readstatus called with invalid driverId!\n" );
@@ -1419,7 +1419,7 @@ if_sendbuf(int id, int channel, int ack, struct sk_buff *skb)return -ENODEV ;/* ack request stored in skb scratch area */ *(skb->head) = ack; -return (isdnloop_sendbuf (channel, skb, card)); +return isdnloop_sendbuf (channel, skb, card); }printk (KERN_ERR "isdnloop: if_sendbuf called with invalid driverId!\n" );
@@ -1499,7 +1499,7 @@ static int __initisdnloop_init (void) {if (isdnloop_id) -return (isdnloop_addcard (isdnloop_id)); +return isdnloop_addcard (isdnloop_id);return 0 ; }
Signature · 1 line
2.1.0
David Miller
maintainerFrom: Bas Peters <[email protected]>
Date: Wed, 4 Feb 2015 23:32:58 +0100
Quoted 1 line
This patchset adresses various checkpatch errors in the abovementioned driver.
Series applied.