From mboxrd@z Thu Jan 1 00:00:00 1970 From: Razvan Cojocaru Subject: Re: [PATCH RFC V7 4/5] xen, libxc: Request page fault injection via libxc Date: Wed, 27 Aug 2014 15:15:09 +0300 Message-ID: <53FDCBCD.7000507@bitdefender.com> References: <1407943689-9249-1-git-send-email-rcojocaru@bitdefender.com> <1407943689-9249-4-git-send-email-rcojocaru@bitdefender.com> <53FCB226020000780002DA7B@mail.emea.novell.com> <53FDC6FD.4040209@bitdefender.com> <53FDE6C6020000780002E018@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53FDE6C6020000780002E018@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: kevin.tian@intel.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, eddie.dong@intel.com, xen-devel@lists.xen.org, jun.nakajima@intel.com, ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On 08/27/2014 03:10 PM, Jan Beulich wrote: >>>> On 27.08.14 at 13:54, wrote: >> On 08/26/2014 05:13 PM, Jan Beulich wrote: >>>>>> On 13.08.14 at 17:28, 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.) I understand, thanks for the reply! I'll change the code. Razvan Cojocaru