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

Re: [Xen-devel] [PATCH] sysctl: adjust XEN_SYSCTL_numainfo behavior



>>> On 14.07.15 at 14:43, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 14/07/15 13:35, Dario Faggioli wrote:
>> On Tue, 2015-07-14 at 10:52 +0100, Jan Beulich wrote:
>>> ... to match XEN_SYSCTL_cputopoinfo, allowing the caller to get what it
>>> needs (if e.g. it's after the data for just one specific node) with
>>> just one hypercall, without caring about the total number of nodes in
>>> the system.
>>>
>>> Suggested-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
>>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>>>
>> Reviewed-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>
>>
>> One question:
>>
>>> --- a/xen/common/sysctl.c
>>> +++ b/xen/common/sysctl.c
>>>  
>>> @@ -335,7 +329,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xe
>>>          else
>>>              i = num_nodes;
>>>  
>>> -        if ( (!ret || (ret == -ENOBUFS)) && (ni->num_nodes != i) )
>>> +        if ( !ret && (ni->num_nodes != i) )
>>>          {
>> Can't we kill the parentheses around the second argument of the && ?
> 
> No.  The coding style requires binary operators as part of larger
> statements to have brackets.

I don't see it requires this, and I can't even find it recommending
such - it just so happens that some people prefer using the extra
parentheses. I personally dislike them for all operators where the
precedence is "natural", i.e. here I wouldn't have added them if
I had written the code anew. Since I modified existing code, I
decided to retain previous style.

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