]> err.no Git - linux-2.6/blobdiff - drivers/usb/misc/usbtest.c
[PATCH] USB: move CONFIG_USB_DEBUG checks into the Makefile
[linux-2.6] / drivers / usb / misc / usbtest.c
index 90a96257d6ce920423ceeac5fd6a57c5f6968d2a..605a2afe34ed614d485aea86195ef7550b073a31 100644 (file)
@@ -1,7 +1,4 @@
 #include <linux/config.h>
-#if !defined (DEBUG) && defined (CONFIG_USB_DEBUG)
-#   define DEBUG
-#endif
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
@@ -9,7 +6,7 @@
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
-#include <asm/scatterlist.h>
+#include <linux/scatterlist.h>
 
 #include <linux/usb.h>
 
@@ -381,7 +378,6 @@ alloc_sglist (int nents, int max, int vary)
        sg = kmalloc (nents * sizeof *sg, SLAB_KERNEL);
        if (!sg)
                return NULL;
-       memset (sg, 0, nents * sizeof *sg);
 
        for (i = 0; i < nents; i++) {
                char            *buf;
@@ -394,9 +390,7 @@ alloc_sglist (int nents, int max, int vary)
                memset (buf, 0, size);
 
                /* kmalloc pages are always physically contiguous! */
-               sg [i].page = virt_to_page (buf);
-               sg [i].offset = offset_in_page (buf);
-               sg [i].length = size;
+               sg_init_one(&sg[i], buf, size);
 
                if (vary) {
                        size += vary;