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

Re: [Xen-devel] [ PATCH 2/2] xen: enable Virtual-interrupt delivery



>>> On 13.09.12 at 12:13, "Li, Jiongxi" <jiongxi.li@xxxxxxxxx> wrote:
>> Considering that the original could already have been written with 
> if/else-if, I
>> was suggesting to expand this to your addition:
>> 
>> if ( cpu_has_vmx_virtual_intr_delivery ) { } else if (a)
>>   {}
>> else if (b)
>>   {}
>> 
>> which will avoid any (indentation only) changes past the first of the two 
> else-if-s.
>> Plus it would make the logic of the code more clear, at once likely making
>> apparent that there'll now be quite a few "goto out"-s that ought to be check
>> for being replaceable by fewer instances of them placed slightly 
> differently.
> It is a good suggestion. But the original code is two parallel if() case, 
> not the if/else-if case, and can't be changed to if/else-if case, so I just 
> keep the original code here. :)

That's simply not true. The code before your patch is

        if ( intblk == hvm_intblk_tpr )
        {
            ...
            goto out;
        }

        if ( (intblk != hvm_intblk_none) || ... )
        {
            ...
            goto out;
        }

which can easily be re-written into and if()/else if() (due to the
goto at the first if() body's end). All you want in your patch is
then to prepend another if() and convert the initial if() into an
else if() too.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.