]> err.no Git - linux-2.6/blobdiff - net/core/user_dma.c
Merge branches 'at91', 'dyntick', 'ep93xx', 'iop', 'ixp', 'misc', 'orion', 'omap...
[linux-2.6] / net / core / user_dma.c
index b7c98dbcdb81102ccd50e0d3f354294eae6c6919..c77aff9c6eb3cc76fab911cdca097cc5add01d8c 100644 (file)
@@ -29,6 +29,7 @@
 #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
 
@@ -57,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;
@@ -74,7 +75,7 @@ int dma_skb_copy_datagram_iovec(struct dma_chan *chan,
 
                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;
 
@@ -107,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;
@@ -127,5 +128,5 @@ end:
        }
 
 fault:
-       return -EFAULT;
+       return -EFAULT;
 }