On 15/12/2014 21:56, Eugene Korenevsky wrote:
> +     u32 inequality, bit;
> +
> +     bit = (vmcs12->exception_bitmap & (1u << PF_VECTOR)) ? 1u : 0;
> +     inequality =
> +             (error_code & vmcs12->page_fault_error_code_mask) !=
> +              vmcs12->page_fault_error_code_match ? 1u : 0;

You should either remove "? 1u : 0" (which is redundant), or flip the
bit in the exception bitmap, like

    inequality = ...
          ? (1u << PF_VECTOR) : 0;
    return ((vmcs12->exception_bitmap ^ inequality)
            & (1u << PF_VECTOR)) != 0;

If you choose the former, please use "!= 0" in the assignment of "bit"
instead of the ternary operator, and make the two variables bool.  Then
you can remove the "!= 0" in the "return" below.

Paolo

> +     return (inequality ^ bit) != 0;
> +}
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to