Re: [PATCH] ivshmem: remove unnecessary checks for unsigned

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(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@xxxxxxxxxxxxxx>
> ---
>  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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux