From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcAum-0005wr-7G for qemu-devel@nongnu.org; Wed, 16 Sep 2015 07:30:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcAuh-00077x-DR for qemu-devel@nongnu.org; Wed, 16 Sep 2015 07:30:16 -0400 Received: from lhrrgout.huawei.com ([194.213.3.17]:61730) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcAug-00077a-Q1 for qemu-devel@nongnu.org; Wed, 16 Sep 2015 07:30:11 -0400 References: <1442333283-13119-1-git-send-email-marcandre.lureau@redhat.com> <1442333283-13119-22-git-send-email-marcandre.lureau@redhat.com> From: Claudio Fontana Message-ID: <55F952BE.1040501@huawei.com> Date: Wed, 16 Sep 2015 13:30:06 +0200 MIME-Version: 1.0 In-Reply-To: <1442333283-13119-22-git-send-email-marcandre.lureau@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v3 21/46] ivshmem: use common return List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org Cc: drjones@redhat.com, cam@cs.ualberta.ca, stefanha@redhat.com On 15.09.2015 18:07, marcandre.lureau@redhat.com wrote: > From: Marc-André Lureau > > Both if branches return, move this out to common end. > > Signed-off-by: Marc-André Lureau > --- > hw/misc/ivshmem.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c > index a60454f..e391396 100644 > --- a/hw/misc/ivshmem.c > +++ b/hw/misc/ivshmem.c > @@ -525,13 +525,12 @@ static void ivshmem_read(void *opaque, const uint8_t *buf, int size) > if (incoming_posn >= 0 && s->vm_id == -1) { > /* receive our posn */ > s->vm_id = incoming_posn; > - return; > } else { > /* otherwise an fd == -1 means an existing guest has gone away */ > IVSHMEM_DPRINTF("posn %ld has gone away\n", incoming_posn); > close_guest_eventfds(s, incoming_posn); > - return; > } > + return; > } > > /* if the position is -1, then it's shared memory region fd */ > Reviewed-by: Claudio Fontana