All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Tim Sander <tim@krieglstein.org>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	qemu-devel@nongnu.org, "Markus Armbruster" <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] i2c-tiny-usb: add new usb to i2c bridge
Date: Thu, 17 Dec 2015 17:15:12 +0100	[thread overview]
Message-ID: <1450368912.5981.17.camel@redhat.com> (raw)
In-Reply-To: <1490778.HifHfFmj7O@hydra>

> +    case 0x4107:
> +        {
> +        int i;
> +        /* this seems to be a byte type access */
> +        if (i2c_start_transfer(s->i2cbus, /*address*/index, 0)) {
> +            trace_usb_i2c_tiny_i2c_start_transfer_failed();
> +            p->actual_length = 0; /* write failure */
> +            break;
> +        }
> +        for (i = 0; i < length; i++) {
> +            trace_usb_i2c_tiny_write(request, index, i, data[i]);
> +            i2c_send(s->i2cbus, data[i]);
> +        }
> +        p->actual_length = length;
> +        i2c_end_transfer(s->i2cbus);
> +        }
> +        break;

Braces look a bit displaced.  How about moving the "int i"; to the start
of the function and drop the braces then?

> +static const VMStateDescription vmstate_usb_i2c = {
> +    .name = "usb-i2c-tiny",
> +    .unmigratable = 1,

I think you can drop the unmigratable line, or replace with
/* nothing */ to make clear it is intentionally empty.

The device is so simple that there is no state to save.  Being migrated
with a half-done i2c transaction isn't possible too.  So it should
survive migration just fine.

Otherwise looks good.

cheers,
  Gerd

  reply	other threads:[~2015-12-17 16:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-26 16:35 [Qemu-devel] [PATCH RFC] i2c-tiny-usb Tim Sander
2015-11-26 18:07 ` Alex Bennée
2015-11-27  8:41   ` Tim Sander
2015-11-27  9:35     ` Markus Armbruster
2015-11-27 11:57     ` Alex Bennée
2015-11-27  6:48 ` Gerd Hoffmann
2015-11-27 10:59   ` Tim Sander
     [not found] ` <56582329.5040304@redhat.com>
2015-11-27 12:39   ` Tim Sander
2015-11-27 12:53     ` Paolo Bonzini
2015-12-09 16:40       ` [Qemu-devel] i2c data address question was " Tim Sander
2015-12-09 17:04         ` Paolo Bonzini
2015-12-16 15:56         ` [Qemu-devel] [PATCH] i2c-tiny-usb: add new usb to i2c bridge Tim Sander
2015-12-17 16:15           ` Gerd Hoffmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-01-04 17:30 Tim Sander
2016-01-05  7:44 ` Gerd Hoffmann
2016-01-05 12:23   ` Tim Sander
2016-01-07  9:48     ` Peter Crosthwaite
2016-01-06 14:58 Tim Sander
2016-01-07 10:14 ` Peter Crosthwaite
2016-01-13 16:07   ` Tim Sander
2016-01-13 20:59     ` Peter Crosthwaite

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=1450368912.5981.17.camel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tim@krieglstein.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.