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

Re: [Xen-devel] [PATCH RFC V7 4/5] xen, libxc: Request page fault injection via libxc



>>> On 27.08.14 at 13:54, <rcojocaru@xxxxxxxxxxxxxxx> wrote:
> On 08/26/2014 05:13 PM, Jan Beulich wrote:
>>>>> On 13.08.14 at 17:28, <rcojocaru@xxxxxxxxxxxxxxx> wrote:
>>> +    case XEN_DOMCTL_set_pagefault_info:
>>> +    {
>>> +        ret = -EINVAL;
>>> +
>>> +        if ( is_hvm_domain(d) )
>>> +        {
>>> +            d->arch.hvm_domain.fault_info.address_space =
>>> +                op->u.set_pagefault_info.address_space;
>>> +            d->arch.hvm_domain.fault_info.virtual_address =
>>> +                op->u.set_pagefault_info.virtual_address;
>>> +            d->arch.hvm_domain.fault_info.errcode =
>>> +                op->u.set_pagefault_info.errcode;
>>> +            d->arch.hvm_domain.fault_info.valid = 1;
>>> +
>>> +            ret = 0;
>>> +        }
>>> +    }
>> 
>> Pointless curly braces.
> 
> You're right, of course, but I've written it like that because that
> seems to be the style (even where it is not necessary / no local
> variables are introduced) in
> do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl).
> 
> Should I break with the coding style for this switch case?

Neither do_domctl() nor x86's arch_do_domctl() really consistently
do like you say. Hence I think rather than continuing the bad habit,
making new additions do better is the right approach. (As to why
I really think this isn't just a cosmetic thing: These braces usually
get placed at the same indentation level as the containing switch
statement's, breaking consistent indentation, potentially leading to
two immediately successive closing braces at the same indentation
level.)

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®.