From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=50795 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OrMQV-0003jw-As for qemu-devel@nongnu.org; Thu, 02 Sep 2010 22:54:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OrMQU-0001Fh-0f for qemu-devel@nongnu.org; Thu, 02 Sep 2010 22:54:51 -0400 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:59763) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OrMQT-0001FD-Hl for qemu-devel@nongnu.org; Thu, 02 Sep 2010 22:54:49 -0400 Received: from m5.gw.fujitsu.co.jp ([10.0.50.75]) by fgwmail6.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o832sjfL012617 for (envelope-from seto.hidetoshi@jp.fujitsu.com); Fri, 3 Sep 2010 11:54:46 +0900 Received: from smail (m5 [127.0.0.1]) by outgoing.m5.gw.fujitsu.co.jp (Postfix) with ESMTP id 2FED145DE56 for ; Fri, 3 Sep 2010 11:54:45 +0900 (JST) Received: from s5.gw.fujitsu.co.jp (s5.gw.fujitsu.co.jp [10.0.50.95]) by m5.gw.fujitsu.co.jp (Postfix) with ESMTP id DBC3845DE51 for ; Fri, 3 Sep 2010 11:54:44 +0900 (JST) Received: from s5.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s5.gw.fujitsu.co.jp (Postfix) with ESMTP id BC0EB1DB8065 for ; Fri, 3 Sep 2010 11:54:44 +0900 (JST) Received: from m107.s.css.fujitsu.com (m107.s.css.fujitsu.com [10.249.87.107]) by s5.gw.fujitsu.co.jp (Postfix) with ESMTP id 3BCAF1DB803F for ; Fri, 3 Sep 2010 11:54:44 +0900 (JST) Message-ID: <4C806363.3080109@jp.fujitsu.com> Date: Fri, 03 Sep 2010 11:54:27 +0900 From: Hidetoshi Seto MIME-Version: 1.0 References: <4C80555B.102@jp.fujitsu.com> In-Reply-To: <4C80555B.102@jp.fujitsu.com> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] ivshmem: remove unnecessary checks for unsigned List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: kvm@vger.kernel.org, qemu-devel@nongnu.org Cc: Jes.Sorensen@redhat.com, Cam Macdonell , "Hao, Xudong" (2010/09/03 10:54), Hidetoshi Seto wrote: > fixes gcc 4.1 warning: > In function 'ivshmem_io_writel': > 202: warning: comparison is always false due to limited range of data type > 208: warning: comparison is always true due to limited range of data type > > Signed-off-by: Hidetoshi Seto > --- > hw/ivshmem.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/ivshmem.c b/hw/ivshmem.c > index bbb5cba..afebbc3 100644 > --- a/hw/ivshmem.c > +++ b/hw/ivshmem.c > @@ -199,13 +199,13 @@ static void ivshmem_io_writel(void *opaque, target_phys_addr_t addr, > > case DOORBELL: > /* check that dest VM ID is reasonable */ > - if ((dest < 0) || (dest > s->max_peer)) { > + if (dest > s->max_peer) { > IVSHMEM_DPRINTF("Invalid destination VM ID (%d)\n", dest); > break; > } > > /* check doorbell range */ > - if ((vector >= 0) && (vector < s->peers[dest].nb_eventfds)) { > + if (vector < s->peers[dest].nb_eventfds) { > IVSHMEM_DPRINTF("Writing %" PRId64 " to VM %d on vector %d\n", > write_one, dest, vector); > if (write(s->peers[dest].eventfds[vector], Oops, since I've registered qemu-kvm ML but not qemu-devel ML, I could not noticed that Jes have already posted same patch to qemu-devel. Now build of ivshmem is enabled only on KVM systems, please apply this patch to qemu-kvm.git asap. Thanks, H.Seto