diff options
Diffstat (limited to 'drivers/net/wan')
-rw-r--r-- | drivers/net/wan/lmc/lmc_main.c | 6 | ||||
-rw-r--r-- | drivers/net/wan/lmc/lmc_media.c | 8 | ||||
-rw-r--r-- | drivers/net/wan/pc300_drv.c | 8 | ||||
-rw-r--r-- | drivers/net/wan/pc300_tty.c | 12 |
4 files changed, 15 insertions, 19 deletions
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c index 37c52e131750..6635ecef36e5 100644 --- a/drivers/net/wan/lmc/lmc_main.c +++ b/drivers/net/wan/lmc/lmc_main.c | |||
@@ -491,13 +491,13 @@ int lmc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/ | |||
491 | int pos; | 491 | int pos; |
492 | int timeout = 500000; | 492 | int timeout = 500000; |
493 | 493 | ||
494 | if(xc.data == 0x0){ | 494 | if (!xc.data) { |
495 | ret = -EINVAL; | 495 | ret = -EINVAL; |
496 | break; | 496 | break; |
497 | } | 497 | } |
498 | 498 | ||
499 | data = kmalloc(xc.len, GFP_KERNEL); | 499 | data = kmalloc(xc.len, GFP_KERNEL); |
500 | if(data == 0x0){ | 500 | if (!data) { |
501 | printk(KERN_WARNING "%s: Failed to allocate memory for copy\n", dev->name); | 501 | printk(KERN_WARNING "%s: Failed to allocate memory for copy\n", dev->name); |
502 | ret = -ENOMEM; | 502 | ret = -ENOMEM; |
503 | break; | 503 | break; |
@@ -1643,7 +1643,7 @@ static int lmc_rx (struct net_device *dev) /*fold00*/ | |||
1643 | * just allocate an skb buff and continue. | 1643 | * just allocate an skb buff and continue. |
1644 | */ | 1644 | */ |
1645 | 1645 | ||
1646 | if(skb == 0x0){ | 1646 | if (!skb) { |
1647 | nsb = dev_alloc_skb (LMC_PKT_BUF_SZ + 2); | 1647 | nsb = dev_alloc_skb (LMC_PKT_BUF_SZ + 2); |
1648 | if (nsb) { | 1648 | if (nsb) { |
1649 | sc->lmc_rxq[i] = nsb; | 1649 | sc->lmc_rxq[i] = nsb; |
diff --git a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c index c9c878cd5c72..8aa461c941ce 100644 --- a/drivers/net/wan/lmc/lmc_media.c +++ b/drivers/net/wan/lmc/lmc_media.c | |||
@@ -1219,10 +1219,6 @@ lmc_t1_watchdog (lmc_softc_t * const sc) | |||
1219 | static void | 1219 | static void |
1220 | lmc_set_protocol (lmc_softc_t * const sc, lmc_ctl_t * ctl) | 1220 | lmc_set_protocol (lmc_softc_t * const sc, lmc_ctl_t * ctl) |
1221 | { | 1221 | { |
1222 | if (ctl == 0) | 1222 | if (!ctl) |
1223 | { | 1223 | sc->ictl.keepalive_onoff = LMC_CTL_ON; |
1224 | sc->ictl.keepalive_onoff = LMC_CTL_ON; | ||
1225 | |||
1226 | return; | ||
1227 | } | ||
1228 | } | 1224 | } |
diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c index 99fee2f1d019..57914fbd41d3 100644 --- a/drivers/net/wan/pc300_drv.c +++ b/drivers/net/wan/pc300_drv.c | |||
@@ -2365,17 +2365,17 @@ static void falc_intr(pc300_t * card) | |||
2365 | 2365 | ||
2366 | static irqreturn_t cpc_intr(int irq, void *dev_id) | 2366 | static irqreturn_t cpc_intr(int irq, void *dev_id) |
2367 | { | 2367 | { |
2368 | pc300_t *card; | 2368 | pc300_t *card = dev_id; |
2369 | volatile ucchar plx_status; | 2369 | volatile ucchar plx_status; |
2370 | 2370 | ||
2371 | if ((card = (pc300_t *) dev_id) == 0) { | 2371 | if (!card) { |
2372 | #ifdef PC300_DEBUG_INTR | 2372 | #ifdef PC300_DEBUG_INTR |
2373 | printk("cpc_intr: spurious intr %d\n", irq); | 2373 | printk("cpc_intr: spurious intr %d\n", irq); |
2374 | #endif | 2374 | #endif |
2375 | return IRQ_NONE; /* spurious intr */ | 2375 | return IRQ_NONE; /* spurious intr */ |
2376 | } | 2376 | } |
2377 | 2377 | ||
2378 | if (card->hw.rambase == 0) { | 2378 | if (!card->hw.rambase) { |
2379 | #ifdef PC300_DEBUG_INTR | 2379 | #ifdef PC300_DEBUG_INTR |
2380 | printk("cpc_intr: spurious intr2 %d\n", irq); | 2380 | printk("cpc_intr: spurious intr2 %d\n", irq); |
2381 | #endif | 2381 | #endif |
@@ -3648,7 +3648,7 @@ static void __devexit cpc_remove_one(struct pci_dev *pdev) | |||
3648 | { | 3648 | { |
3649 | pc300_t *card = pci_get_drvdata(pdev); | 3649 | pc300_t *card = pci_get_drvdata(pdev); |
3650 | 3650 | ||
3651 | if (card->hw.rambase != 0) { | 3651 | if (card->hw.rambase) { |
3652 | int i; | 3652 | int i; |
3653 | 3653 | ||
3654 | /* Disable interrupts on the PCI bridge */ | 3654 | /* Disable interrupts on the PCI bridge */ |
diff --git a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c index e24a7b095dd6..63abfd72542d 100644 --- a/drivers/net/wan/pc300_tty.c +++ b/drivers/net/wan/pc300_tty.c | |||
@@ -313,7 +313,7 @@ static int cpc_tty_open(struct tty_struct *tty, struct file *flip) | |||
313 | if (cpc_tty->num_open == 0) { /* first open of this tty */ | 313 | if (cpc_tty->num_open == 0) { /* first open of this tty */ |
314 | if (!cpc_tty_area[port].buf_tx){ | 314 | if (!cpc_tty_area[port].buf_tx){ |
315 | cpc_tty_area[port].buf_tx = kmalloc(CPC_TTY_MAX_MTU,GFP_KERNEL); | 315 | cpc_tty_area[port].buf_tx = kmalloc(CPC_TTY_MAX_MTU,GFP_KERNEL); |
316 | if (cpc_tty_area[port].buf_tx == 0){ | 316 | if (!cpc_tty_area[port].buf_tx) { |
317 | CPC_TTY_DBG("%s: error in memory allocation\n",cpc_tty->name); | 317 | CPC_TTY_DBG("%s: error in memory allocation\n",cpc_tty->name); |
318 | return -ENOMEM; | 318 | return -ENOMEM; |
319 | } | 319 | } |
@@ -678,7 +678,7 @@ static void cpc_tty_rx_work(struct work_struct *work) | |||
678 | for (j=0; j < CPC_TTY_NPORTS; j++) { | 678 | for (j=0; j < CPC_TTY_NPORTS; j++) { |
679 | cpc_tty = &cpc_tty_area[port]; | 679 | cpc_tty = &cpc_tty_area[port]; |
680 | 680 | ||
681 | if ((buf=cpc_tty->buf_rx.first) != 0) { | 681 | if ((buf=cpc_tty->buf_rx.first) != NULL) { |
682 | if (cpc_tty->tty) { | 682 | if (cpc_tty->tty) { |
683 | ld = tty_ldisc_ref(cpc_tty->tty); | 683 | ld = tty_ldisc_ref(cpc_tty->tty); |
684 | if (ld) { | 684 | if (ld) { |
@@ -784,7 +784,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev) | |||
784 | } | 784 | } |
785 | 785 | ||
786 | new = kmalloc(rx_len + sizeof(st_cpc_rx_buf), GFP_ATOMIC); | 786 | new = kmalloc(rx_len + sizeof(st_cpc_rx_buf), GFP_ATOMIC); |
787 | if (new == 0) { | 787 | if (!new) { |
788 | cpc_tty_rx_disc_frame(pc300chan); | 788 | cpc_tty_rx_disc_frame(pc300chan); |
789 | continue; | 789 | continue; |
790 | } | 790 | } |
@@ -863,7 +863,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev) | |||
863 | } | 863 | } |
864 | new->size = rx_len; | 864 | new->size = rx_len; |
865 | new->next = NULL; | 865 | new->next = NULL; |
866 | if (cpc_tty->buf_rx.first == 0) { | 866 | if (cpc_tty->buf_rx.first == NULL) { |
867 | cpc_tty->buf_rx.first = new; | 867 | cpc_tty->buf_rx.first = new; |
868 | cpc_tty->buf_rx.last = new; | 868 | cpc_tty->buf_rx.last = new; |
869 | } else { | 869 | } else { |
@@ -891,7 +891,7 @@ static void cpc_tty_tx_work(struct work_struct *work) | |||
891 | 891 | ||
892 | CPC_TTY_DBG("%s: cpc_tty_tx_work init\n",cpc_tty->name); | 892 | CPC_TTY_DBG("%s: cpc_tty_tx_work init\n",cpc_tty->name); |
893 | 893 | ||
894 | if ((tty = cpc_tty->tty) == 0) { | 894 | if ((tty = cpc_tty->tty) == NULL) { |
895 | CPC_TTY_DBG("%s: the interface is not opened\n",cpc_tty->name); | 895 | CPC_TTY_DBG("%s: the interface is not opened\n",cpc_tty->name); |
896 | return; | 896 | return; |
897 | } | 897 | } |
@@ -1027,7 +1027,7 @@ void cpc_tty_unregister_service(pc300dev_t *pc300dev) | |||
1027 | ulong flags; | 1027 | ulong flags; |
1028 | int res; | 1028 | int res; |
1029 | 1029 | ||
1030 | if ((cpc_tty= (st_cpc_tty_area *) pc300dev->cpc_tty) == 0) { | 1030 | if ((cpc_tty= (st_cpc_tty_area *) pc300dev->cpc_tty) == NULL) { |
1031 | CPC_TTY_DBG("%s: interface is not TTY\n", pc300dev->dev->name); | 1031 | CPC_TTY_DBG("%s: interface is not TTY\n", pc300dev->dev->name); |
1032 | return; | 1032 | return; |
1033 | } | 1033 | } |