From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hidetoshi Seto Subject: Re: [PATCH] ivshmem: remove unnecessary checks for unsigned Date: Fri, 03 Sep 2010 11:54:27 +0900 Message-ID: <4C806363.3080109@jp.fujitsu.com> References: <4C80555B.102@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Cc: Cam Macdonell , "Hao, Xudong" , Jes.Sorensen@redhat.com To: kvm@vger.kernel.org, qemu-devel@nongnu.org Return-path: Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:45580 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755003Ab0ICCyq (ORCPT ); Thu, 2 Sep 2010 22:54:46 -0400 Received: from m2.gw.fujitsu.co.jp ([10.0.50.72]) by fgwmail5.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o832sida031277 for (envelope-from seto.hidetoshi@jp.fujitsu.com); Fri, 3 Sep 2010 11:54:45 +0900 Received: from smail (m2 [127.0.0.1]) by outgoing.m2.gw.fujitsu.co.jp (Postfix) with ESMTP id B819545DE57 for ; Fri, 3 Sep 2010 11:54:44 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (s2.gw.fujitsu.co.jp [10.0.50.92]) by m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 8C8EB45DE5D for ; Fri, 3 Sep 2010 11:54:44 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id 719E61DB803A 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 s2.gw.fujitsu.co.jp (Postfix) with ESMTP id 2C9E01DB803C for ; Fri, 3 Sep 2010 11:54:44 +0900 (JST) In-Reply-To: <4C80555B.102@jp.fujitsu.com> Sender: kvm-owner@vger.kernel.org List-ID: (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