diff options
| author | David Hardeman <[email protected]> | 2005-09-17 07:55:31 +0000 |
|---|---|---|
| committer | Herbert Xu <[email protected]> | 2005-10-30 00:19:43 +0000 |
| commit | 378f058cc49bcda7fa63d3cd86d2f9a0a5188b1c (patch) | |
| tree | ed99548aa459054c7b046f0ac96af2cc50683e6e /drivers/usb/misc/usbtest.c | |
| parent | [PATCH] Introduce sg_set_buf (diff) | |
| download | kernel-378f058cc49bcda7fa63d3cd86d2f9a0a5188b1c.tar.gz kernel-378f058cc49bcda7fa63d3cd86d2f9a0a5188b1c.zip | |
[PATCH] Use sg_set_buf/sg_init_one where applicable
This patch uses sg_set_buf/sg_init_one in some places where it was
duplicated.
Signed-off-by: David Hardeman <[email protected]>
Cc: James Bottomley <[email protected]>
Cc: Greg KH <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Jeff Garzik <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
Diffstat (limited to 'drivers/usb/misc/usbtest.c')
| -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 @@ #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 +381,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 +393,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; |
