From: "Jan Beulich" Subject: [PATCH] slightly simplify SCHEDOP_remote_shutdown handling Date: Wed, 17 Jun 2015 13:55:49 +0100 Message-ID: <55818A75020000780008621C@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part97A34E45.1__=" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z5Csj-0002aU-2K for xen-devel@lists.xenproject.org; Wed, 17 Jun 2015 12:55:53 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: George Dunlap , Ian Campbell , Keir Fraser , Ian Jackson , Tim Deegan List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part97A34E45.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline There's no need for two exit paths each using rcu_unlock_domain() on its own here. Signed-off-by: Jan Beulich --- 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; =20 ret =3D 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); =20 rcu_unlock_domain(d); - ret =3D 0; =20 break; } --=__Part97A34E45.1__= Content-Type: text/plain; name="simplify-schedop-remote-shutdown.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="simplify-schedop-remote-shutdown.patch" slightly simplify SCHEDOP_remote_shutdown handling=0A=0AThere's no need = for two exit paths each using rcu_unlock_domain() on=0Aits own here.=0A=0AS= igned-off-by: Jan Beulich =0A=0A--- a/xen/common/schedul= e.c=0A+++ b/xen/common/schedule.c=0A@@ -970,16 +970,10 @@ ret_t do_sched_op= (int cmd, XEN_GUEST_HAN=0A break;=0A =0A ret =3D = xsm_schedop_shutdown(XSM_DM_PRIV, current->domain, d);=0A- if ( ret = )=0A- {=0A- rcu_unlock_domain(d);=0A- return = ret;=0A- }=0A-=0A- domain_shutdown(d, (u8)sched_remote_shutdo= wn.reason);=0A+ if ( likely(!ret) )=0A+ domain_shutdown(d= , sched_remote_shutdown.reason);=0A =0A rcu_unlock_domain(d);=0A- = ret =3D 0;=0A =0A break;=0A }=0A --=__Part97A34E45.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part97A34E45.1__=--