wimax: oops: wimax_dev_add() is the only one that can initialize the state
[safe/jmp/linux-2.6] / net / core / user_dma.c
index 248a6b6..164b090 100644 (file)
 
 #include <linux/dmaengine.h>
 #include <linux/socket.h>
-#include <linux/rtnetlink.h> /* for BUG_TRAP */
 #include <net/tcp.h>
 #include <net/netdma.h>
 
 #define NET_DMA_DEFAULT_COPYBREAK 4096
 
 int sysctl_tcp_dma_copybreak = NET_DMA_DEFAULT_COPYBREAK;
+EXPORT_SYMBOL(sysctl_tcp_dma_copybreak);
 
 /**
  *     dma_skb_copy_datagram_iovec - Copy a datagram to an iovec.
@@ -58,7 +58,7 @@ int dma_skb_copy_datagram_iovec(struct dma_chan *chan,
                if (copy > len)
                        copy = len;
                cookie = dma_memcpy_to_iovec(chan, to, pinned_list,
-                                           skb->data + offset, copy);
+                                           skb->data + offset, copy);
                if (cookie < 0)
                        goto fault;
                len -= copy;
@@ -71,11 +71,11 @@ int dma_skb_copy_datagram_iovec(struct dma_chan *chan,
        for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
                int end;
 
-               BUG_TRAP(start <= offset + len);
+               WARN_ON(start > offset + len);
 
                end = start + skb_shinfo(skb)->frags[i].size;
                copy = end - offset;
-               if ((copy = end - offset) > 0) {
+               if (copy > 0) {
                        skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
                        struct page *page = frag->page;
 
@@ -100,7 +100,7 @@ int dma_skb_copy_datagram_iovec(struct dma_chan *chan,
                for (; list; list = list->next) {
                        int end;
 
-                       BUG_TRAP(start <= offset + len);
+                       WARN_ON(start > offset + len);
 
                        end = start + list->len;
                        copy = end - offset;
@@ -108,8 +108,8 @@ int dma_skb_copy_datagram_iovec(struct dma_chan *chan,
                                if (copy > len)
                                        copy = len;
                                cookie = dma_skb_copy_datagram_iovec(chan, list,
-                                               offset - start, to, copy,
-                                               pinned_list);
+                                               offset - start, to, copy,
+                                               pinned_list);
                                if (cookie < 0)
                                        goto fault;
                                len -= copy;
@@ -128,5 +128,5 @@ end:
        }
 
 fault:
-       return -EFAULT;
+       return -EFAULT;
 }