All of lore.kernel.org
 help / color / mirror / Atom feed
From: sangsu <sangsu@gmail.com>
To: stern@rowland.harvard.edu
Cc: david-b@pacbell.net, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] USB: g_printer: fix handling zero-length packet
Date: Fri, 19 Sep 2008 21:00:37 -0400	[thread overview]
Message-ID: <48D44B35.10105@gmail.com> (raw)

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);

             reply	other threads:[~2008-09-20  1:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-20  1:00 sangsu [this message]
2008-09-20 16:34 ` [PATCH] USB: g_printer: fix handling zero-length packet Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48D44B35.10105@gmail.com \
    --to=sangsu@gmail.com \
    --cc=david-b@pacbell.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.