include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[safe/jmp/linux-2.6] / drivers / dma / dmatest.c
index 948d563..68d58c4 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/random.h>
+#include <linux/slab.h>
 #include <linux/wait.h>
 
 static unsigned int test_buf_size = 16384;
@@ -237,7 +238,7 @@ static int dmatest_func(void *data)
        dma_cookie_t            cookie;
        enum dma_status         status;
        enum dma_ctrl_flags     flags;
-       u8                      pq_coefs[pq_sources];
+       u8                      pq_coefs[pq_sources + 1];
        int                     ret;
        int                     src_cnt;
        int                     dst_cnt;
@@ -257,7 +258,7 @@ static int dmatest_func(void *data)
        } else if (thread->type == DMA_PQ) {
                src_cnt = pq_sources | 1; /* force odd to ensure dst = src */
                dst_cnt = 2;
-               for (i = 0; i < pq_sources; i++)
+               for (i = 0; i < src_cnt; i++)
                        pq_coefs[i] = 1;
        } else
                goto err_srcs;
@@ -347,7 +348,7 @@ static int dmatest_func(void *data)
                else if (thread->type == DMA_XOR)
                        tx = dev->device_prep_dma_xor(chan,
                                                      dma_dsts[0] + dst_off,
-                                                     dma_srcs, xor_sources,
+                                                     dma_srcs, src_cnt,
                                                      len, flags);
                else if (thread->type == DMA_PQ) {
                        dma_addr_t dma_pq[dst_cnt];
@@ -355,7 +356,7 @@ static int dmatest_func(void *data)
                        for (i = 0; i < dst_cnt; i++)
                                dma_pq[i] = dma_dsts[i] + dst_off;
                        tx = dev->device_prep_dma_pq(chan, dma_pq, dma_srcs,
-                                                    pq_sources, pq_coefs,
+                                                    src_cnt, pq_coefs,
                                                     len, flags);
                }