From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBXLn-000585-2U for qemu-devel@nongnu.org; Wed, 05 Oct 2011 15:41:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBXLl-0006Bq-Kn for qemu-devel@nongnu.org; Wed, 05 Oct 2011 15:41:55 -0400 Received: from mail-yx0-f173.google.com ([209.85.213.173]:37544) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBXLl-0006Bk-IL for qemu-devel@nongnu.org; Wed, 05 Oct 2011 15:41:53 -0400 Received: by yxl11 with SMTP id 11so2316823yxl.4 for ; Wed, 05 Oct 2011 12:41:53 -0700 (PDT) Message-ID: <4E8CB2FD.7080208@codemonkey.ws> Date: Wed, 05 Oct 2011 14:41:49 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <93c7221dab90d3f79bd6b6badb7228bd4dc8bc74.1317738629.git.quintela@redhat.com> In-Reply-To: <93c7221dab90d3f79bd6b6badb7228bd4dc8bc74.1317738629.git.quintela@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/4] savevm: some coding style cleanups List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: pbonzini@redhat.com, qemu-devel@nongnu.org On 10/04/2011 09:38 AM, Juan Quintela wrote: > This patch will make moving code on next patches and having checkpatch > happy easier. > > Signed-off-by: Juan Quintela Reviewed-by: Anthony Liguori Regards, Anthony Liguori > --- > savevm.c | 21 ++++++++++++++------- > 1 files changed, 14 insertions(+), 7 deletions(-) > > diff --git a/savevm.c b/savevm.c > index 31131df..5fee4e2 100644 > --- a/savevm.c > +++ b/savevm.c > @@ -536,8 +536,9 @@ int qemu_get_buffer(QEMUFile *f, uint8_t *buf, int size1) > { > int size, l; > > - if (f->is_write) > + if (f->is_write) { > abort(); > + } > > size = size1; > while (size> 0) { > @@ -545,11 +546,13 @@ int qemu_get_buffer(QEMUFile *f, uint8_t *buf, int size1) > if (l == 0) { > qemu_fill_buffer(f); > l = f->buf_size - f->buf_index; > - if (l == 0) > + if (l == 0) { > break; > + } > } > - if (l> size) > + if (l> size) { > l = size; > + } > memcpy(buf, f->buf + f->buf_index, l); > f->buf_index += l; > buf += l; > @@ -560,26 +563,30 @@ int qemu_get_buffer(QEMUFile *f, uint8_t *buf, int size1) > > static int qemu_peek_byte(QEMUFile *f) > { > - if (f->is_write) > + if (f->is_write) { > abort(); > + } > > if (f->buf_index>= f->buf_size) { > qemu_fill_buffer(f); > - if (f->buf_index>= f->buf_size) > + if (f->buf_index>= f->buf_size) { > return 0; > + } > } > return f->buf[f->buf_index]; > } > > int qemu_get_byte(QEMUFile *f) > { > - if (f->is_write) > + if (f->is_write) { > abort(); > + } > > if (f->buf_index>= f->buf_size) { > qemu_fill_buffer(f); > - if (f->buf_index>= f->buf_size) > + if (f->buf_index>= f->buf_size) { > return 0; > + } > } > return f->buf[f->buf_index++]; > }