From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "QEMU Developers" <qemu-devel@nongnu.org>,
"Hervé Poussineau" <hpoussin@reactos.org>,
"Amit Shah" <amit.shah@redhat.com>,
"Juan Quintela" <quintela@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 4/5] vmstateify tsc2005
Date: Thu, 22 Sep 2016 16:53:39 +0100 [thread overview]
Message-ID: <20160922155339.GI2085@work-vm> (raw)
In-Reply-To: <CAFEAcA_inxAPHBAHsHmMoj6yosC5vqL9x6XTnEGQXArffS6vDQ@mail.gmail.com>
* Peter Maydell (peter.maydell@linaro.org) wrote:
> On 24 August 2016 at 11:40, Dr. David Alan Gilbert (git)
> <dgilbert@redhat.com> wrote:
> > From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> >
> > I've converted the fields in it's main data structure
> > to fixed size types in ways that look sane, but I don't actually
> > know the details of this hardware.
>
> This is the kind of thing that should go below the '---',
> not in the commit message proper (at least not in this phrasing,
> in my opinion).
I can fix that.
> The TSC2005 datasheet is http://www.ti.com/lit/ds/symlink/tsc2005.pdf .
>
> > Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> > ---
> > hw/input/tsc2005.c | 154 ++++++++++++++++++++---------------------------------
> > 1 file changed, 57 insertions(+), 97 deletions(-)
> >
> > diff --git a/hw/input/tsc2005.c b/hw/input/tsc2005.c
> > index 9b359aa..b66dc50 100644
> > --- a/hw/input/tsc2005.c
> > +++ b/hw/input/tsc2005.c
> > @@ -31,30 +31,31 @@ typedef struct {
> > QEMUTimer *timer;
> > uint16_t model;
> >
> > - int x, y;
> > - int pressure;
> > + int32_t x, y;
> > + bool pressure;
> >
> > - int state, reg, irq, command;
> > + uint8_t reg, state;
> > + bool irq, command;
> > uint16_t data, dav;
> >
> > - int busy;
> > - int enabled;
> > - int host_mode;
> > - int function;
> > - int nextfunction;
> > - int precision;
> > - int nextprecision;
> > - int filter;
> > - int pin_func;
> > - int timing[2];
> > - int noise;
> > - int reset;
> > - int pdst;
> > - int pnd0;
> > + bool busy;
> > + bool enabled;
>
> These changes mean the code is now doing bitwise-logic on
> bool variables, for instance:
> s->busy &= s->enabled;
> We also assign '0' and '1' to them rather than 'true' and 'false'.
Yes, I went through and as far as I can tell they're always
used as booleans already.
> > + bool host_mode;
> > + int8_t function;
> > + int8_t nextfunction;
> > + bool precision;
> > + bool nextprecision;
> > + uint16_t filter;
> > + uint8_t pin_func;
> > + int16_t timing[2];
>
> Why not uint16_t ?
Yep, I'll fix that.
> > + uint8_t noise;
> > + bool reset;
> > + bool pdst;
> > + bool pnd0;
> > uint16_t temp_thr[2];
> > uint16_t aux_thr[2];
> >
> > - int tr[8];
> > + int32_t tr[8];
> > } TSC2005State;
>
> Looks ok otherwise.
>
> thanks
> -- PMM
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2016-09-22 15:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-24 10:40 [Qemu-devel] [PATCH v2 0/5] vmstateify a bunch of rare devices [for 2.8] Dr. David Alan Gilbert (git)
2016-08-24 10:40 ` [Qemu-devel] [PATCH v2 1/5] vmstateify ssd0323 display Dr. David Alan Gilbert (git)
2016-08-24 10:40 ` [Qemu-devel] [PATCH v2 2/5] vmstateify rc4030 Dr. David Alan Gilbert (git)
2016-09-26 12:05 ` Dr. David Alan Gilbert
2016-08-24 10:40 ` [Qemu-devel] [PATCH v2 3/5] vmstateify ssi-sd Dr. David Alan Gilbert (git)
2016-08-24 10:40 ` [Qemu-devel] [PATCH v2 4/5] vmstateify tsc2005 Dr. David Alan Gilbert (git)
2016-09-22 15:41 ` Peter Maydell
2016-09-22 15:53 ` Dr. David Alan Gilbert [this message]
2016-09-22 16:00 ` Peter Maydell
2016-08-24 10:40 ` [Qemu-devel] [PATCH v2 5/5] vmstateify tsc210x Dr. David Alan Gilbert (git)
2016-09-22 16:12 ` Peter Maydell
2016-09-22 16:13 ` [Qemu-devel] [PATCH v2 0/5] vmstateify a bunch of rare devices [for 2.8] Peter Maydell
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=20160922155339.GI2085@work-vm \
--to=dgilbert@redhat.com \
--cc=amit.shah@redhat.com \
--cc=hpoussin@reactos.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/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).