]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/wan/pc300_tty.c
[MIPS] rbtx4938: minor cleanup
[linux-2.6-omap-h63xx.git] / drivers / net / wan / pc300_tty.c
index 5873c346e7e9ee25ee53f3679982407c6b99d0eb..63abfd72542d118c7a8b93f25cbd5ed3098337ca 100644 (file)
@@ -38,7 +38,6 @@
 
 #include <linux/module.h>
 #include <linux/kernel.h>
-#include <linux/pci.h>
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/init.h>
@@ -314,7 +313,7 @@ static int cpc_tty_open(struct tty_struct *tty, struct file *flip)
        if (cpc_tty->num_open == 0) { /* first open of this tty */
                if (!cpc_tty_area[port].buf_tx){
                        cpc_tty_area[port].buf_tx = kmalloc(CPC_TTY_MAX_MTU,GFP_KERNEL);
-                       if (cpc_tty_area[port].buf_tx == 0){
+                       if (!cpc_tty_area[port].buf_tx) {
                                CPC_TTY_DBG("%s: error in memory allocation\n",cpc_tty->name);
                                return -ENOMEM;
                        }
@@ -679,7 +678,7 @@ static void cpc_tty_rx_work(struct work_struct *work)
                for (j=0; j < CPC_TTY_NPORTS; j++) {
                        cpc_tty = &cpc_tty_area[port];
                
-                       if ((buf=cpc_tty->buf_rx.first) != 0) {
+                       if ((buf=cpc_tty->buf_rx.first) != NULL) {
                                if (cpc_tty->tty) {
                                        ld = tty_ldisc_ref(cpc_tty->tty);
                                        if (ld) {
@@ -785,7 +784,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev)
                } 
                
                new = kmalloc(rx_len + sizeof(st_cpc_rx_buf), GFP_ATOMIC);
-               if (new == 0) {
+               if (!new) {
                        cpc_tty_rx_disc_frame(pc300chan);
                        continue;
                }
@@ -864,7 +863,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev)
                        } 
                        new->size = rx_len;
                        new->next = NULL;
-                       if (cpc_tty->buf_rx.first == 0) {
+                       if (cpc_tty->buf_rx.first == NULL) {
                                cpc_tty->buf_rx.first = new;
                                cpc_tty->buf_rx.last = new;
                        } else {
@@ -892,7 +891,7 @@ static void cpc_tty_tx_work(struct work_struct *work)
 
        CPC_TTY_DBG("%s: cpc_tty_tx_work init\n",cpc_tty->name);
        
-       if ((tty = cpc_tty->tty) == 0) { 
+       if ((tty = cpc_tty->tty) == NULL) { 
                CPC_TTY_DBG("%s: the interface is not opened\n",cpc_tty->name);
                return; 
        }
@@ -1003,17 +1002,17 @@ static void cpc_tty_trace(pc300dev_t *dev, char* buf, int len, char rxtx)
        skb_put (skb, 10 + len); 
        skb->dev = dev->dev; 
        skb->protocol = htons(ETH_P_CUST); 
-       skb->mac.raw = skb->data; 
+       skb_reset_mac_header(skb);
        skb->pkt_type = PACKET_HOST; 
        skb->len = 10 + len; 
 
-       memcpy(skb->data,dev->dev->name,5);
+       skb_copy_to_linear_data(skb, dev->dev->name, 5);
        skb->data[5] = '['; 
        skb->data[6] = rxtx; 
        skb->data[7] = ']'; 
        skb->data[8] = ':'; 
        skb->data[9] = ' '; 
-       memcpy(&skb->data[10], buf, len); 
+       skb_copy_to_linear_data_offset(skb, 10, buf, len);
        netif_rx(skb); 
 }      
 
@@ -1028,7 +1027,7 @@ void cpc_tty_unregister_service(pc300dev_t *pc300dev)
        ulong flags;
        int res;
 
-       if ((cpc_tty= (st_cpc_tty_area *) pc300dev->cpc_tty) == 0) { 
+       if ((cpc_tty= (st_cpc_tty_area *) pc300dev->cpc_tty) == NULL) {
                CPC_TTY_DBG("%s: interface is not TTY\n", pc300dev->dev->name);
                return; 
        }