All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neal Liu <neal_liu@aspeedtech.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Joel Stanley <joel@jms.id.au>, Andrew Jeffery <andrew@aj.id.au>,
	"linux-aspeed@lists.ozlabs.org" <linux-aspeed@lists.ozlabs.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: RE: [PATCH] usb: gadget: aspeed_udc: fix handling of tx_len == 0
Date: Thu, 23 Jun 2022 08:37:33 +0000	[thread overview]
Message-ID: <HK0PR06MB32023509F00B62CFEFF0EAC980B59@HK0PR06MB3202.apcprd06.prod.outlook.com> (raw)
In-Reply-To: <20220623075503.GC11460@kadam>


> On Thu, Jun 23, 2022 at 07:52:28AM +0000, Neal Liu wrote:
> > > On Thu, Jun 23, 2022 at 09:43:20AM +0300, Dan Carpenter wrote:
> > > > On Thu, Jun 23, 2022 at 01:41:49AM +0000, Neal Liu wrote:
> > > > > > The bug is that we should still enter this loop if "tx_len" is zero.
> > > > > >
> > > > > > After adding the "last" variable, then the "chunk >= 0"
> > > > > > condition is no longer required but I left it for readability.
> > > > > >
> > > > >
> > > > > Use either "chunk >=0" or "last".
> > > > > I think the former is more simpler.
> > > >
> > > > chunk >= 0 doesn't work.  last works but I think this way is more
> > > > readable.
> > >
> > > Fine, I can remove the chunk >= 0.  But you can see why your idea of
> > > removing the "last" doesn't work, right?  I mean maybe it does work
> > > and there was a bug in the original code?  Could you please look at
> > > that so we're for sure writing correct code?
> > >
> >
> > Why removing the "last" doesn't work? If "chunk == 0", it would go through
> while loop once, and chunk will be negative (chunk -= ep->chunk_max).
> >
> 
> chunk -= ep->chunk_max could set chunk to zero.
> 
Looks reasonable. Feel free to add:

Reviewed-by: Neal Liu <neal_liu@aspeedtech.com>

Thanks

  reply	other threads:[~2022-06-23  8:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-22 14:50 [PATCH] usb: gadget: aspeed_udc: fix handling of tx_len == 0 Dan Carpenter
2022-06-23  1:41 ` Neal Liu
2022-06-23  6:43   ` Dan Carpenter
2022-06-23  7:22     ` Dan Carpenter
2022-06-23  7:52       ` Neal Liu
2022-06-23  7:55         ` Dan Carpenter
2022-06-23  8:37           ` Neal Liu [this message]
2022-06-24  6:17     ` Herrenschmidt, Benjamin
2022-06-24  6:34       ` Dan Carpenter
2022-06-24  6:39         ` Benjamin Herrenschmidt
2022-06-24  7:46           ` Neal Liu
2022-06-27  1:30             ` Benjamin Herrenschmidt
2022-06-28  7:17               ` Neal Liu

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=HK0PR06MB32023509F00B62CFEFF0EAC980B59@HK0PR06MB3202.apcprd06.prod.outlook.com \
    --to=neal_liu@aspeedtech.com \
    --cc=andrew@aj.id.au \
    --cc=balbi@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joel@jms.id.au \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-usb@vger.kernel.org \
    /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.