From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH] slightly simplify SCHEDOP_remote_shutdown handling Date: Wed, 17 Jun 2015 13:59:45 +0100 Message-ID: <55816F41.2040109@eu.citrix.com> References: <55818A75020000780008621C@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z5Cwx-0003UZ-3C for xen-devel@lists.xenproject.org; Wed, 17 Jun 2015 13:00:15 +0000 In-Reply-To: <55818A75020000780008621C@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 , xen-devel Cc: Ian Campbell , Keir Fraser , Ian Jackson , Tim Deegan List-Id: xen-devel@lists.xenproject.org On 06/17/2015 01:55 PM, Jan Beulich wrote: > There's no need for two exit paths each using rcu_unlock_domain() on > its own here. > > Signed-off-by: Jan Beulich Acked-by: George Dunlap > > --- a/xen/common/schedule.c > +++ b/xen/common/schedule.c > @@ -970,16 +970,10 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HAN > break; > > ret = xsm_schedop_shutdown(XSM_DM_PRIV, current->domain, d); > - if ( ret ) > - { > - rcu_unlock_domain(d); > - return ret; > - } > - > - domain_shutdown(d, (u8)sched_remote_shutdown.reason); > + if ( likely(!ret) ) > + domain_shutdown(d, sched_remote_shutdown.reason); > > rcu_unlock_domain(d); > - ret = 0; > > break; > } > > >