From 34f38b0475fbff7c61216c2d4fa95b2aacfe777a Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Mon, 10 Sep 2012 15:01:51 +0200 Subject: [PATCH] --- yaml --- r: 325912 b: refs/heads/master c: e13f17ff8854e04cfc6b9f981a974f55d8da9b92 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/usb/gadget/composite.c | 10 ++++------ trunk/drivers/usb/gadget/f_sourcesink.c | 2 +- trunk/include/linux/usb/composite.h | 3 +++ 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 57aaadbc4ba7..d7e806776e84 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: dc995fc27c2e1c8edebfb2405ede23bd38153f7f +refs/heads/master: e13f17ff8854e04cfc6b9f981a974f55d8da9b92 diff --git a/trunk/drivers/usb/gadget/composite.c b/trunk/drivers/usb/gadget/composite.c index 0b6ee2012af1..52689ee9db12 100644 --- a/trunk/drivers/usb/gadget/composite.c +++ b/trunk/drivers/usb/gadget/composite.c @@ -28,9 +28,6 @@ * with the relevant device-wide data. */ -/* big enough to hold our biggest descriptor */ -#define USB_BUFSIZ 1024 - /* Some systems will need runtime overrides for the product identifiers * published in the device descriptor, either numbers or strings or both. * String parameters are in UTF-8 (superset of ASCII's 7 bit characters). @@ -355,10 +352,11 @@ static int config_buf(struct usb_configuration *config, { struct usb_config_descriptor *c = buf; void *next = buf + USB_DT_CONFIG_SIZE; - int len = USB_BUFSIZ - USB_DT_CONFIG_SIZE; + int len; struct usb_function *f; int status; + len = USB_COMP_EP0_BUFSIZ - USB_DT_CONFIG_SIZE; /* write the config descriptor */ c = buf; c->bLength = USB_DT_CONFIG_SIZE; @@ -1445,13 +1443,13 @@ static int composite_bind(struct usb_gadget *gadget, cdev->req = usb_ep_alloc_request(gadget->ep0, GFP_KERNEL); if (!cdev->req) goto fail; - cdev->req->buf = kmalloc(USB_BUFSIZ, GFP_KERNEL); + cdev->req->buf = kmalloc(USB_COMP_EP0_BUFSIZ, GFP_KERNEL); if (!cdev->req->buf) goto fail; cdev->req->complete = composite_setup_complete; gadget->ep0->driver_data = cdev; - cdev->bufsiz = USB_BUFSIZ; + cdev->bufsiz = USB_COMP_EP0_BUFSIZ; cdev->driver = composite; /* diff --git a/trunk/drivers/usb/gadget/f_sourcesink.c b/trunk/drivers/usb/gadget/f_sourcesink.c index 5c1b68b63c98..3c126fde6e7e 100644 --- a/trunk/drivers/usb/gadget/f_sourcesink.c +++ b/trunk/drivers/usb/gadget/f_sourcesink.c @@ -795,7 +795,7 @@ static int sourcesink_setup(struct usb_configuration *c, u16 w_value = le16_to_cpu(ctrl->wValue); u16 w_length = le16_to_cpu(ctrl->wLength); - req->length = USB_BUFSIZ; + req->length = USB_COMP_EP0_BUFSIZ; /* composite driver infrastructure handles everything except * the two control test requests. diff --git a/trunk/include/linux/usb/composite.h b/trunk/include/linux/usb/composite.h index 43d6b9ca51b7..89d91b671eb0 100644 --- a/trunk/include/linux/usb/composite.h +++ b/trunk/include/linux/usb/composite.h @@ -46,6 +46,9 @@ */ #define USB_GADGET_DELAYED_STATUS 0x7fff /* Impossibly large value */ +/* big enough to hold our biggest descriptor */ +#define USB_COMP_EP0_BUFSIZ 1024 + struct usb_configuration; /**