Commit ee05e5f7 authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by Greg Kroah-Hartman

staging: i4l: icn: donot assign in if statement

It is not the kernel coding style to make assignments in the if
statement and checkpatch was warning us about it.
Signed-off-by: default avatarSudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3fe7034e
...@@ -62,7 +62,8 @@ icn_free_queue(icn_card *card, int channel) ...@@ -62,7 +62,8 @@ icn_free_queue(icn_card *card, int channel)
skb_queue_purge(queue); skb_queue_purge(queue);
card->xlen[channel] = 0; card->xlen[channel] = 0;
card->sndcount[channel] = 0; card->sndcount[channel] = 0;
if ((skb = card->xskb[channel])) { skb = card->xskb[channel];
if (skb) {
card->xskb[channel] = NULL; card->xskb[channel] = NULL;
dev_kfree_skb(skb); dev_kfree_skb(skb);
} }
...@@ -272,8 +273,10 @@ icn_pollbchan_receive(int channel, icn_card *card) ...@@ -272,8 +273,10 @@ icn_pollbchan_receive(int channel, icn_card *card)
rbnext; rbnext;
icn_maprelease_channel(card, mch & 2); icn_maprelease_channel(card, mch & 2);
if (!eflag) { if (!eflag) {
if ((cnt = card->rcvidx[channel])) { cnt = card->rcvidx[channel];
if (!(skb = dev_alloc_skb(cnt))) { if (cnt) {
skb = dev_alloc_skb(cnt);
if (!skb) {
printk(KERN_WARNING "icn: receive out of memory\n"); printk(KERN_WARNING "icn: receive out of memory\n");
break; break;
} }
...@@ -807,7 +810,8 @@ icn_loadboot(u_char __user *buffer, icn_card *card) ...@@ -807,7 +810,8 @@ icn_loadboot(u_char __user *buffer, icn_card *card)
#ifdef BOOT_DEBUG #ifdef BOOT_DEBUG
printk(KERN_DEBUG "icn_loadboot called, buffaddr=%08lx\n", (ulong) buffer); printk(KERN_DEBUG "icn_loadboot called, buffaddr=%08lx\n", (ulong) buffer);
#endif #endif
if (!(codebuf = kmalloc(ICN_CODE_STAGE1, GFP_KERNEL))) { codebuf = kmalloc(ICN_CODE_STAGE1, GFP_KERNEL);
if (!codebuf) {
printk(KERN_WARNING "icn: Could not allocate code buffer\n"); printk(KERN_WARNING "icn: Could not allocate code buffer\n");
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
...@@ -878,7 +882,8 @@ icn_loadboot(u_char __user *buffer, icn_card *card) ...@@ -878,7 +882,8 @@ icn_loadboot(u_char __user *buffer, icn_card *card)
} }
SLEEP(1); SLEEP(1);
OUTB_P(0xff, ICN_RUN); /* Start Boot-Code */ OUTB_P(0xff, ICN_RUN); /* Start Boot-Code */
if ((ret = icn_check_loader(card->doubleS0 ? 2 : 1))) { ret = icn_check_loader(card->doubleS0 ? 2 : 1);
if (ret) {
goto out_kfree; goto out_kfree;
} }
if (!card->doubleS0) { if (!card->doubleS0) {
...@@ -1248,7 +1253,8 @@ icn_command(isdn_ctrl *c, icn_card *card) ...@@ -1248,7 +1253,8 @@ icn_command(isdn_ctrl *c, icn_card *card)
return icn_loadboot(arg, card); return icn_loadboot(arg, card);
case ICN_IOCTL_LOADPROTO: case ICN_IOCTL_LOADPROTO:
icn_stopcard(card); icn_stopcard(card);
if ((i = (icn_loadproto(arg, card)))) i = (icn_loadproto(arg, card));
if (i)
return i; return i;
if (card->doubleS0) if (card->doubleS0)
i = icn_loadproto(arg + ICN_CODE_STAGE2, card->other); i = icn_loadproto(arg + ICN_CODE_STAGE2, card->other);
...@@ -1519,7 +1525,8 @@ icn_initcard(int port, char *id) ...@@ -1519,7 +1525,8 @@ icn_initcard(int port, char *id)
icn_card *card; icn_card *card;
int i; int i;
if (!(card = kzalloc(sizeof(icn_card), GFP_KERNEL))) { card = kzalloc(sizeof(icn_card), GFP_KERNEL);
if (!card) {
printk(KERN_WARNING printk(KERN_WARNING
"icn: (%s) Could not allocate card-struct.\n", id); "icn: (%s) Could not allocate card-struct.\n", id);
return (icn_card *) 0; return (icn_card *) 0;
...@@ -1567,7 +1574,8 @@ icn_addcard(int port, char *id1, char *id2) ...@@ -1567,7 +1574,8 @@ icn_addcard(int port, char *id1, char *id2)
icn_card *card; icn_card *card;
icn_card *card2; icn_card *card2;
if (!(card = icn_initcard(port, id1))) { card = icn_initcard(port, id1);
if (!card) {
return -EIO; return -EIO;
} }
if (!strlen(id2)) { if (!strlen(id2)) {
...@@ -1576,7 +1584,8 @@ icn_addcard(int port, char *id1, char *id2) ...@@ -1576,7 +1584,8 @@ icn_addcard(int port, char *id1, char *id2)
card->interface.id, port); card->interface.id, port);
return 0; return 0;
} }
if (!(card2 = icn_initcard(port, id2))) { card2 = icn_initcard(port, id2);
if (!card2) {
printk(KERN_INFO printk(KERN_INFO
"icn: (%s) half ICN-4B, port 0x%x added\n", id2, port); "icn: (%s) half ICN-4B, port 0x%x added\n", id2, port);
return 0; return 0;
...@@ -1610,7 +1619,8 @@ icn_setup(char *line) ...@@ -1610,7 +1619,8 @@ icn_setup(char *line)
if (str && *str) { if (str && *str) {
strlcpy(sid, str, sizeof(sid)); strlcpy(sid, str, sizeof(sid));
icn_id = sid; icn_id = sid;
if ((p = strchr(sid, ','))) { p = strchr(sid, ',');
if (p) {
*p++ = 0; *p++ = 0;
strcpy(sid2, p); strcpy(sid2, p);
icn_id2 = sid2; icn_id2 = sid2;
...@@ -1633,7 +1643,8 @@ static int __init icn_init(void) ...@@ -1633,7 +1643,8 @@ static int __init icn_init(void)
dev.firstload = 1; dev.firstload = 1;
spin_lock_init(&dev.devlock); spin_lock_init(&dev.devlock);
if ((p = strchr(revision, ':'))) { p = strchr(revision, ':');
if (p) {
strncpy(rev, p + 1, 20); strncpy(rev, p + 1, 20);
rev[20] = '\0'; rev[20] = '\0';
p = strchr(rev, '$'); p = strchr(rev, '$');
......
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