Commit b0ebfaea authored by David S. Miller's avatar David S. Miller

Merge branch 'isdnloop_checkpatch'

Bas Peters says:

====================
Fix checkpatch errors in drivers/isdn/isdnloop

This patchset adresses various checkpatch errors in the abovementioned driver.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 6e03f896 3581ec58
...@@ -59,7 +59,8 @@ isdnloop_bchan_send(isdnloop_card *card, int ch) ...@@ -59,7 +59,8 @@ isdnloop_bchan_send(isdnloop_card *card, int ch)
isdn_ctrl cmd; isdn_ctrl cmd;
while (card->sndcount[ch]) { while (card->sndcount[ch]) {
if ((skb = skb_dequeue(&card->bqueue[ch]))) { skb = skb_dequeue(&card->bqueue[ch]);
if (skb) {
len = skb->len; len = skb->len;
card->sndcount[ch] -= len; card->sndcount[ch] -= len;
ack = *(skb->head); /* used as scratch area */ ack = *(skb->head); /* used as scratch area */
...@@ -149,8 +150,7 @@ typedef struct isdnloop_stat { ...@@ -149,8 +150,7 @@ typedef struct isdnloop_stat {
int action; int action;
} isdnloop_stat; } isdnloop_stat;
/* *INDENT-OFF* */ /* *INDENT-OFF* */
static isdnloop_stat isdnloop_stat_table[] = static isdnloop_stat isdnloop_stat_table[] = {
{
{"BCON_", ISDN_STAT_BCONN, 1}, /* B-Channel connected */ {"BCON_", ISDN_STAT_BCONN, 1}, /* B-Channel connected */
{"BDIS_", ISDN_STAT_BHUP, 2}, /* B-Channel disconnected */ {"BDIS_", ISDN_STAT_BHUP, 2}, /* B-Channel disconnected */
{"DCON_", ISDN_STAT_DCONN, 0}, /* D-Channel connected */ {"DCON_", ISDN_STAT_DCONN, 0}, /* D-Channel connected */
...@@ -317,7 +317,8 @@ isdnloop_polldchan(unsigned long data) ...@@ -317,7 +317,8 @@ isdnloop_polldchan(unsigned long data)
u_char *p; u_char *p;
isdn_ctrl cmd; isdn_ctrl cmd;
if ((skb = skb_dequeue(&card->dqueue))) skb = skb_dequeue(&card->dqueue);
if (skb)
avail = skb->len; avail = skb->len;
else else
avail = 0; avail = 0;
...@@ -471,8 +472,8 @@ isdnloop_fake(isdnloop_card *card, char *s, int ch) ...@@ -471,8 +472,8 @@ isdnloop_fake(isdnloop_card *card, char *s, int ch)
{ {
struct sk_buff *skb; struct sk_buff *skb;
int len = strlen(s) + ((ch >= 0) ? 3 : 0); int len = strlen(s) + ((ch >= 0) ? 3 : 0);
skb = dev_alloc_skb(len);
if (!(skb = dev_alloc_skb(len))) { if (!skb) {
printk(KERN_WARNING "isdnloop: Out of memory in isdnloop_fake\n"); printk(KERN_WARNING "isdnloop: Out of memory in isdnloop_fake\n");
return 1; return 1;
} }
...@@ -483,8 +484,7 @@ isdnloop_fake(isdnloop_card *card, char *s, int ch) ...@@ -483,8 +484,7 @@ isdnloop_fake(isdnloop_card *card, char *s, int ch)
return 0; return 0;
} }
/* *INDENT-OFF* */ /* *INDENT-OFF* */
static isdnloop_stat isdnloop_cmd_table[] = static isdnloop_stat isdnloop_cmd_table[] = {
{
{"BCON_R", 0, 1}, /* B-Channel connect */ {"BCON_R", 0, 1}, /* B-Channel connect */
{"BCON_I", 0, 17}, /* B-Channel connect ind */ {"BCON_I", 0, 17}, /* B-Channel connect ind */
{"BDIS_R", 0, 2}, /* B-Channel disconnect */ {"BDIS_R", 0, 2}, /* B-Channel disconnect */
...@@ -525,10 +525,8 @@ isdnloop_fake_err(isdnloop_card *card) ...@@ -525,10 +525,8 @@ isdnloop_fake_err(isdnloop_card *card)
isdnloop_fake(card, "NAK", -1); isdnloop_fake(card, "NAK", -1);
} }
static u_char ctable_eu[] = static u_char ctable_eu[] = {0x00, 0x11, 0x01, 0x12};
{0x00, 0x11, 0x01, 0x12}; static u_char ctable_1t[] = {0x00, 0x3b, 0x01, 0x3a};
static u_char ctable_1t[] =
{0x00, 0x3b, 0x01, 0x3a};
/* /*
* Assemble a simplified cause message depending on the * Assemble a simplified cause message depending on the
...@@ -554,9 +552,9 @@ isdnloop_unicause(isdnloop_card *card, int loc, int cau) ...@@ -554,9 +552,9 @@ isdnloop_unicause(isdnloop_card *card, int loc, int cau)
sprintf(buf, "%02X44", ctable_1t[cau]); sprintf(buf, "%02X44", ctable_1t[cau]);
break; break;
default: default:
return ("0000"); return "0000";
} }
return (buf); return buf;
} }
/* /*
...@@ -647,10 +645,8 @@ isdnloop_kill_ctimer(isdnloop_card *card, int ch) ...@@ -647,10 +645,8 @@ isdnloop_kill_ctimer(isdnloop_card *card, int ch)
spin_unlock_irqrestore(&card->isdnloop_lock, flags); spin_unlock_irqrestore(&card->isdnloop_lock, flags);
} }
static u_char si2bit[] = static u_char si2bit[] = {0, 1, 0, 0, 0, 2, 0, 4, 0, 0};
{0, 1, 0, 0, 0, 2, 0, 4, 0, 0}; static u_char bit2si[] = {1, 5, 7};
static u_char bit2si[] =
{1, 5, 7};
/* /*
* Try finding a listener for an outgoing call. * Try finding a listener for an outgoing call.
...@@ -754,17 +750,17 @@ isdnloop_vstphone(isdnloop_card *card, char *phone, int caller) ...@@ -754,17 +750,17 @@ isdnloop_vstphone(isdnloop_card *card, char *phone, int caller)
if (caller) { if (caller) {
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
if (!(strcmp(card->s0num[i], phone))) if (!(strcmp(card->s0num[i], phone)))
return (phone); return phone;
return (card->s0num[0]); return card->s0num[0];
} }
return (phone); return phone;
break; break;
case ISDN_PTYPE_1TR6: case ISDN_PTYPE_1TR6:
if (caller) { if (caller) {
sprintf(nphone, "%s%c", card->s0num[0], phone[0]); sprintf(nphone, "%s%c", card->s0num[0], phone[0]);
return (nphone); return nphone;
} else } else
return (&phone[strlen(phone) - 1]); return &phone[strlen(phone) - 1];
break; break;
} }
return ""; return "";
...@@ -1148,14 +1144,14 @@ isdnloop_command(isdn_ctrl *c, isdnloop_card *card) ...@@ -1148,14 +1144,14 @@ isdnloop_command(isdn_ctrl *c, isdnloop_card *card)
case ISDNLOOP_IOCTL_STARTUP: case ISDNLOOP_IOCTL_STARTUP:
if (!access_ok(VERIFY_READ, (void *) a, sizeof(isdnloop_sdef))) if (!access_ok(VERIFY_READ, (void *) a, sizeof(isdnloop_sdef)))
return -EFAULT; return -EFAULT;
return (isdnloop_start(card, (isdnloop_sdef *) a)); return isdnloop_start(card, (isdnloop_sdef *) a);
break; break;
case ISDNLOOP_IOCTL_ADDCARD: case ISDNLOOP_IOCTL_ADDCARD:
if (copy_from_user((char *)&cdef, if (copy_from_user((char *)&cdef,
(char *)a, (char *)a,
sizeof(cdef))) sizeof(cdef)))
return -EFAULT; return -EFAULT;
return (isdnloop_addcard(cdef.id1)); return isdnloop_addcard(cdef.id1);
break; break;
case ISDNLOOP_IOCTL_LEASEDCFG: case ISDNLOOP_IOCTL_LEASEDCFG:
if (a) { if (a) {
...@@ -1377,7 +1373,7 @@ if_command(isdn_ctrl *c) ...@@ -1377,7 +1373,7 @@ if_command(isdn_ctrl *c)
isdnloop_card *card = isdnloop_findcard(c->driver); isdnloop_card *card = isdnloop_findcard(c->driver);
if (card) if (card)
return (isdnloop_command(c, card)); return isdnloop_command(c, card);
printk(KERN_ERR printk(KERN_ERR
"isdnloop: if_command called with invalid driverId!\n"); "isdnloop: if_command called with invalid driverId!\n");
return -ENODEV; return -ENODEV;
...@@ -1391,7 +1387,7 @@ if_writecmd(const u_char __user *buf, int len, int id, int channel) ...@@ -1391,7 +1387,7 @@ if_writecmd(const u_char __user *buf, int len, int id, int channel)
if (card) { if (card) {
if (!(card->flags & ISDNLOOP_FLAGS_RUNNING)) if (!(card->flags & ISDNLOOP_FLAGS_RUNNING))
return -ENODEV; return -ENODEV;
return (isdnloop_writecmd(buf, len, 1, card)); return isdnloop_writecmd(buf, len, 1, card);
} }
printk(KERN_ERR printk(KERN_ERR
"isdnloop: if_writecmd called with invalid driverId!\n"); "isdnloop: if_writecmd called with invalid driverId!\n");
...@@ -1406,7 +1402,7 @@ if_readstatus(u_char __user *buf, int len, int id, int channel) ...@@ -1406,7 +1402,7 @@ if_readstatus(u_char __user *buf, int len, int id, int channel)
if (card) { if (card) {
if (!(card->flags & ISDNLOOP_FLAGS_RUNNING)) if (!(card->flags & ISDNLOOP_FLAGS_RUNNING))
return -ENODEV; return -ENODEV;
return (isdnloop_readstatus(buf, len, card)); return isdnloop_readstatus(buf, len, card);
} }
printk(KERN_ERR printk(KERN_ERR
"isdnloop: if_readstatus called with invalid driverId!\n"); "isdnloop: if_readstatus called with invalid driverId!\n");
...@@ -1423,7 +1419,7 @@ if_sendbuf(int id, int channel, int ack, struct sk_buff *skb) ...@@ -1423,7 +1419,7 @@ if_sendbuf(int id, int channel, int ack, struct sk_buff *skb)
return -ENODEV; return -ENODEV;
/* ack request stored in skb scratch area */ /* ack request stored in skb scratch area */
*(skb->head) = ack; *(skb->head) = ack;
return (isdnloop_sendbuf(channel, skb, card)); return isdnloop_sendbuf(channel, skb, card);
} }
printk(KERN_ERR printk(KERN_ERR
"isdnloop: if_sendbuf called with invalid driverId!\n"); "isdnloop: if_sendbuf called with invalid driverId!\n");
...@@ -1439,8 +1435,8 @@ isdnloop_initcard(char *id) ...@@ -1439,8 +1435,8 @@ isdnloop_initcard(char *id)
{ {
isdnloop_card *card; isdnloop_card *card;
int i; int i;
card = kzalloc(sizeof(isdnloop_card), GFP_KERNEL);
if (!(card = kzalloc(sizeof(isdnloop_card), GFP_KERNEL))) { if (!card) {
printk(KERN_WARNING printk(KERN_WARNING
"isdnloop: (%s) Could not allocate card-struct.\n", id); "isdnloop: (%s) Could not allocate card-struct.\n", id);
return (isdnloop_card *) 0; return (isdnloop_card *) 0;
...@@ -1489,8 +1485,8 @@ static int ...@@ -1489,8 +1485,8 @@ static int
isdnloop_addcard(char *id1) isdnloop_addcard(char *id1)
{ {
isdnloop_card *card; isdnloop_card *card;
card = isdnloop_initcard(id1);
if (!(card = isdnloop_initcard(id1))) { if (!card) {
return -EIO; return -EIO;
} }
printk(KERN_INFO printk(KERN_INFO
...@@ -1503,7 +1499,7 @@ static int __init ...@@ -1503,7 +1499,7 @@ static int __init
isdnloop_init(void) isdnloop_init(void)
{ {
if (isdnloop_id) if (isdnloop_id)
return (isdnloop_addcard(isdnloop_id)); return isdnloop_addcard(isdnloop_id);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment