--- zzzz-none-000/linux-3.10.107/drivers/isdn/isdnloop/isdnloop.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/isdn/isdnloop/isdnloop.c 2021-02-04 17:41:59.000000000 +0000 @@ -59,7 +59,8 @@ 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 */ @@ -149,8 +150,7 @@ 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 */ @@ -317,7 +317,8 @@ 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 +472,8 @@ { 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; } @@ -483,8 +484,7 @@ 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 */ @@ -525,10 +525,8 @@ 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 @@ -554,9 +552,9 @@ sprintf(buf, "%02X44", ctable_1t[cau]); break; default: - return ("0000"); + return "0000"; } - return (buf); + return buf; } /* @@ -647,10 +645,8 @@ 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. @@ -754,17 +750,17 @@ 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 ""; @@ -1148,14 +1144,14 @@ 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) { @@ -1377,7 +1373,7 @@ 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; @@ -1391,7 +1387,7 @@ 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"); @@ -1406,7 +1402,7 @@ 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"); @@ -1423,7 +1419,7 @@ 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"); @@ -1439,8 +1435,8 @@ { 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 +1485,8 @@ isdnloop_addcard(char *id1) { isdnloop_card *card; - - if (!(card = isdnloop_initcard(id1))) { + card = isdnloop_initcard(id1); + if (!card) { return -EIO; } printk(KERN_INFO @@ -1503,7 +1499,7 @@ isdnloop_init(void) { if (isdnloop_id) - return (isdnloop_addcard(isdnloop_id)); + return isdnloop_addcard(isdnloop_id); return 0; }