Re: [PATCH v2] kvm tools: remove redundant "if" condition

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

 



On Wed, Jan 16, 2013 at 6:52 PM, Cong Ding <dinggnu@xxxxxxxxx> wrote:
> After we check (state.kcount != 0), state.kcount has to be 0 in all the "else"
> branchs.
>
> Signed-off-by: Cong Ding <dinggnu@xxxxxxxxx>
> ---
>  tools/kvm/hw/i8042.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/kvm/hw/i8042.c b/tools/kvm/hw/i8042.c
> index 9f8be6a..9035732 100644
> --- a/tools/kvm/hw/i8042.c
> +++ b/tools/kvm/hw/i8042.c
> @@ -189,7 +189,7 @@ static u32 kbd_read_data(void)
>                 state.mcount--;
>                 kvm__irq_line(state.kvm, AUX_IRQ, 0);
>                 kbd_update_irq();
> -       } else if (state.kcount == 0) {
> +       } else {
>                 i = state.kread - 1;
>                 if (i < 0)
>                         i = QUEUE_SIZE;

This doesn't look right. The 'kcount' field is an int so the value can
be negative.
--
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