From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn67s-0001DO-9A for qemu-devel@nongnu.org; Thu, 22 Sep 2016 11:41:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn67r-0007BY-3i for qemu-devel@nongnu.org; Thu, 22 Sep 2016 11:41:28 -0400 Received: from mail-ua0-x22e.google.com ([2607:f8b0:400c:c08::22e]:32881) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn67q-0007BQ-TG for qemu-devel@nongnu.org; Thu, 22 Sep 2016 11:41:27 -0400 Received: by mail-ua0-x22e.google.com with SMTP id u68so3059412uau.0 for ; Thu, 22 Sep 2016 08:41:26 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1472035246-12483-5-git-send-email-dgilbert@redhat.com> References: <1472035246-12483-1-git-send-email-dgilbert@redhat.com> <1472035246-12483-5-git-send-email-dgilbert@redhat.com> From: Peter Maydell Date: Thu, 22 Sep 2016 16:41:05 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v2 4/5] vmstateify tsc2005 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" Cc: QEMU Developers , =?UTF-8?Q?Herv=C3=A9_Poussineau?= , Amit Shah , Juan Quintela On 24 August 2016 at 11:40, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > 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). The TSC2005 datasheet is http://www.ti.com/lit/ds/symlink/tsc2005.pdf . > Signed-off-by: Dr. David Alan Gilbert > --- > 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'. > + 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 ? > + 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