From: "Jan Beulich" Subject: Re: [PATCH] sysctl: adjust XEN_SYSCTL_numainfo behavior Date: Tue, 14 Jul 2015 14:17:55 +0100 Message-ID: <55A528230200007800090B77@mail.emea.novell.com> References: <55A4F7F002000078000908B4@mail.emea.novell.com> <1436877325.13522.87.camel@citrix.com> <55A503EA.2090804@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZF05w-0000l0-AR for xen-devel@lists.xenproject.org; Tue, 14 Jul 2015 13:18:00 +0000 In-Reply-To: <55A503EA.2090804@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper , Dario Faggioli Cc: Keir Fraser , Tim Deegan , Ian Jackson , Ian Campbell , xen-devel , Boris Ostrovsky List-Id: xen-devel@lists.xenproject.org >>> On 14.07.15 at 14:43, 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 >>> Signed-off-by: Jan Beulich >>> >> Reviewed-by: Dario Faggioli >> >> 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