* [PATCH] USB: g_printer: fix handling zero-length packet
@ 2008-09-20 1:00 sangsu
2008-09-20 16:34 ` Alan Stern
0 siblings, 1 reply; 2+ messages in thread
From: sangsu @ 2008-09-20 1:00 UTC (permalink / raw)
To: stern; +Cc: david-b, linux-usb, linux-kernel
g_printer doesn't have to check whether the data size is a multiple of
MaxPacketSize, because device controller driver already make that check.
Signed-off-by: SangSu Park<sangsu@gmail.com>
---
drivers/usb/gadget/printer.c | 3++-
1 files changed, 2 insertion(+), 1 deletions(-)
--- a/drivers/usb/gadget/printer.c 2008-08-12 21:55:39.000000000 -0400
+++ b/drivers/usb/gadget/printer.c 2008-09-19 20:39:44.000000000 -0400
@@ -1264,8 +1264,7 @@
/* respond with data transfer before status phase? */
if (value >= 0) {
req->length = value;
- req->zero = value < wLength
- && (value % gadget->ep0->maxpacket) == 0;
+ req->zero = value < wLength;
value = usb_ep_queue(gadget->ep0, req, GFP_ATOMIC);
if (value < 0) {
DBG(dev, "ep_queue --> %d\n", value);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] USB: g_printer: fix handling zero-length packet
2008-09-20 1:00 [PATCH] USB: g_printer: fix handling zero-length packet sangsu
@ 2008-09-20 16:34 ` Alan Stern
0 siblings, 0 replies; 2+ messages in thread
From: Alan Stern @ 2008-09-20 16:34 UTC (permalink / raw)
To: sangsu; +Cc: Greg KH, David Brownell, USB list, Kernel development list
On Fri, 19 Sep 2008, sangsu wrote:
> g_printer doesn't have to check whether the data size is a multiple of
> MaxPacketSize, because device controller driver already make that check.
>
> Signed-off-by: SangSu Park<sangsu@gmail.com>
> ---
> drivers/usb/gadget/printer.c | 3++-
> 1 files changed, 2 insertion(+), 1 deletions(-)
>
>
> --- a/drivers/usb/gadget/printer.c 2008-08-12 21:55:39.000000000 -0400
> +++ b/drivers/usb/gadget/printer.c 2008-09-19 20:39:44.000000000 -0400
> @@ -1264,8 +1264,7 @@
> /* respond with data transfer before status phase? */
> if (value >= 0) {
> req->length = value;
> - req->zero = value < wLength
> - && (value % gadget->ep0->maxpacket) == 0;
> + req->zero = value < wLength;
> value = usb_ep_queue(gadget->ep0, req, GFP_ATOMIC);
> if (value < 0) {
> DBG(dev, "ep_queue --> %d\n", value);
When posting changes like this you should add Greg KH to the CC: list;
otherwise he won't realize this patch needs to be merged.
You should also CC: the author of the original code -- but in this case
you can't because Craig Nadler didn't include his email address in the
source file.
For what it's worth, this patch looks okay to me.
Alan Stern
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-20 16:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-20 1:00 [PATCH] USB: g_printer: fix handling zero-length packet sangsu
2008-09-20 16:34 ` Alan Stern
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox