diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/misc/usbtest.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index 90a96257d6ce..2997f558159b 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c | |||
@@ -9,7 +9,7 @@ | |||
9 | #include <linux/mm.h> | 9 | #include <linux/mm.h> |
10 | #include <linux/module.h> | 10 | #include <linux/module.h> |
11 | #include <linux/moduleparam.h> | 11 | #include <linux/moduleparam.h> |
12 | #include <asm/scatterlist.h> | 12 | #include <linux/scatterlist.h> |
13 | 13 | ||
14 | #include <linux/usb.h> | 14 | #include <linux/usb.h> |
15 | 15 | ||
@@ -381,7 +381,6 @@ alloc_sglist (int nents, int max, int vary) | |||
381 | sg = kmalloc (nents * sizeof *sg, SLAB_KERNEL); | 381 | sg = kmalloc (nents * sizeof *sg, SLAB_KERNEL); |
382 | if (!sg) | 382 | if (!sg) |
383 | return NULL; | 383 | return NULL; |
384 | memset (sg, 0, nents * sizeof *sg); | ||
385 | 384 | ||
386 | for (i = 0; i < nents; i++) { | 385 | for (i = 0; i < nents; i++) { |
387 | char *buf; | 386 | char *buf; |
@@ -394,9 +393,7 @@ alloc_sglist (int nents, int max, int vary) | |||
394 | memset (buf, 0, size); | 393 | memset (buf, 0, size); |
395 | 394 | ||
396 | /* kmalloc pages are always physically contiguous! */ | 395 | /* kmalloc pages are always physically contiguous! */ |
397 | sg [i].page = virt_to_page (buf); | 396 | sg_init_one(&sg[i], buf, size); |
398 | sg [i].offset = offset_in_page (buf); | ||
399 | sg [i].length = size; | ||
400 | 397 | ||
401 | if (vary) { | 398 | if (vary) { |
402 | size += vary; | 399 | size += vary; |