kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ivshmem: remove unnecessary checks for unsigned
@ 2010-09-03  1:54 Hidetoshi Seto
  2010-09-03  2:54 ` Hidetoshi Seto
  0 siblings, 1 reply; 4+ messages in thread
From: Hidetoshi Seto @ 2010-09-03  1:54 UTC (permalink / raw)
  To: kvm, qemu-devel; +Cc: Cam Macdonell, Hao, Xudong

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 <seto.hidetoshi@jp.fujitsu.com>
---
 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],
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ivshmem: remove unnecessary checks for unsigned
  2010-09-03  1:54 [PATCH] ivshmem: remove unnecessary checks for unsigned Hidetoshi Seto
@ 2010-09-03  2:54 ` Hidetoshi Seto
  2010-09-05  8:21   ` Avi Kivity
  0 siblings, 1 reply; 4+ messages in thread
From: Hidetoshi Seto @ 2010-09-03  2:54 UTC (permalink / raw)
  To: kvm, qemu-devel; +Cc: Cam Macdonell, Hao, Xudong, Jes.Sorensen

(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 <seto.hidetoshi@jp.fujitsu.com>
> ---
>  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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ivshmem: remove unnecessary checks for unsigned
  2010-09-03  2:54 ` Hidetoshi Seto
@ 2010-09-05  8:21   ` Avi Kivity
  2010-09-06  1:59     ` Hao, Xudong
  0 siblings, 1 reply; 4+ messages in thread
From: Avi Kivity @ 2010-09-05  8:21 UTC (permalink / raw)
  To: Hidetoshi Seto; +Cc: kvm, qemu-devel, Cam Macdonell, Hao, Xudong, Jes.Sorensen

 On 09/03/2010 05:54 AM, Hidetoshi Seto wrote:
>
> 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.
>

This was already applied to qemu.git; I'll pull it into qemu-kvm.git to
fix the build.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] ivshmem: remove unnecessary checks for unsigned
  2010-09-05  8:21   ` Avi Kivity
@ 2010-09-06  1:59     ` Hao, Xudong
  0 siblings, 0 replies; 4+ messages in thread
From: Hao, Xudong @ 2010-09-06  1:59 UTC (permalink / raw)
  To: Avi Kivity, Hidetoshi Seto; +Cc: kvm, qemu-devel, Cam Macdonell, Jes.Sorensen

Avi Kivity wrote:
>  On 09/03/2010 05:54 AM, Hidetoshi Seto wrote:
>> 
>> 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. 
>> 
> 
> This was already applied to qemu.git; I'll pull it into qemu-kvm.git
> to fix the build.

Qemu-kvm 6ee63ef38696aa3b0518f6aa6b85bc111ba7ca4e can build successfully now, thanks all.

-Xudong

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-09-06  2:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-03  1:54 [PATCH] ivshmem: remove unnecessary checks for unsigned Hidetoshi Seto
2010-09-03  2:54 ` Hidetoshi Seto
2010-09-05  8:21   ` Avi Kivity
2010-09-06  1:59     ` Hao, Xudong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).