qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org, dgilbert@redhat.com
Subject: Re: [Qemu-devel] [PATCH] usb: fix up post load checks
Date: Tue, 13 May 2014 12:05:07 +0300	[thread overview]
Message-ID: <20140513090507.GA29760@redhat.com> (raw)
In-Reply-To: <1399970685.7118.45.camel@nilsson.home.kraxel.org>

On Tue, May 13, 2014 at 10:44:45AM +0200, Gerd Hoffmann wrote:
> On Di, 2014-05-13 at 11:32 +0300, Michael S. Tsirkin wrote:
> > On Tue, May 13, 2014 at 09:50:09AM +0200, Gerd Hoffmann wrote:
> > >   Hi,
> > > 
> > > > +        (dev->setup_state == SETUP_STATE_DATA &&
> > > 
> > > Fails to build, SETUP_STATE_DATA is not defined here.
> > > 
> > > I think we can simply drop that check, index should never ever be larger
> > > than len, no matter what the state is.
> > > 
> > > cheers,
> > >   Gerd
> > 
> > I'm confused by usb_generic_async_ctrl_complete which can modify len
> > without touching index.
> 
> only in setup state, before any data from/to the buffer is transfered,
> so index is still zero at that point.


And SETUP_STATE_PARAM?

> flow is this:
> 
> state_setup: len = $buflen, index = 0
> state_data:  xfer %buf data, increase index up to len while doing so.
> state_ack:   index == len
> state_idle:  likewise.
> 
> cheers,
>   Gerd
> 

  reply	other threads:[~2014-05-13  9:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-12 12:16 [Qemu-devel] [PATCH] usb: fix up post load checks Michael S. Tsirkin
2014-05-13  3:02 ` Gonglei (Arei)
2014-05-13  6:49   ` Gerd Hoffmann
2014-05-13  7:50 ` Gerd Hoffmann
2014-05-13  8:32   ` Michael S. Tsirkin
2014-05-13  8:44     ` Gerd Hoffmann
2014-05-13  9:05       ` Michael S. Tsirkin [this message]
2014-05-13  9:49         ` Gerd Hoffmann
2014-05-14 13:16 ` Michael S. Tsirkin

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=20140513090507.GA29760@redhat.com \
    --to=mst@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).