From nobody Fri Apr 19 04:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1578332303; cv=none; d=zohomail.com; s=zohoarc; b=GJnD9ahQcPwnUum7h1+vVUufp1f6QRnsKTQ8HEEWgJaYlR8jvCaErIEV3+G+lUKI5PpTHerMNI3In2enT5zyj6fKKrXgb+o6un4QlutXMxQjaNrzjyxA46w4eWWSOPvfKgDaaNX7B304mQvBJnu2ypc2WHHJK9vmubmo6JWUmE8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578332303; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=7qRSsterYDl3LKOV3WWblZVSp/G+upZImbl+3JKsFEU=; b=VnOmk7Ng941vcR21hmpt2hfkENaaOoXyp0KN/lIOshLTqL9Q0nV5xhp4AMtjm5WnaRxCw3LHgd1/PKsmb22j6+/OR+h9j+Y0XQV+Clps/VXrQ7CwaFmtBv8AsAHSwBv+OTcmpFKpi9/r0A7Wtor4cs0a4zkWQmMpfMlpK1x/Ev4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1578332303681266.6537851025611; Mon, 6 Jan 2020 09:38:23 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ioWJZ-0007UQ-TW; Mon, 06 Jan 2020 17:37:17 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ioWJY-0007UL-Tn for xen-devel@lists.xenproject.org; Mon, 06 Jan 2020 17:37:16 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 28da4392-30ab-11ea-88e7-bc764e2007e4; Mon, 06 Jan 2020 17:37:07 +0000 (UTC) X-Inumbo-ID: 28da4392-30ab-11ea-88e7-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1578332228; h=from:to:cc:subject:date:message-id:mime-version; bh=+I3LKUW/7R/pIq00V+ne+xhkFOqgWlxS6A9JuuSfvNE=; b=gfbEH7NfSooXY9iv8qURaeWh0ISU/lPWinrl1GAwfWA7AlWvudlBA//O Si+RLbiXp/lgMv57o66WdpYs+cnAJ7MOgE0abM4Ispeby7/+Xai1Ezi6D S8JU3AhznymfMn6QsnfyqChzl94dFN3htTB5n4HjV/0rrWaNvRtYwujml M=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: SL4Dy1VqKYK075GrjiZyoSGNGZETGfyyS8cLv1eG9LCknzsyNrbC37XkiNAgzvTiGgMmrmfcRp WTxk4ldOxJegGlsLgQYPN0a42nPiWLlv9H3l1k8IlCcCdYbf0JdW16wQ+JZAU9nd/DKMiPETXG OHMgKLBJ32ZuU9QvklqUGV+nxX2vdP/01VEkyBMXnyns3P4edrmr2FyCbmUZEsR5wVr/b/x4/s wNSBES5dq36RscHYap4LI8n6Hgwekf4tg1yUTdTTZE2uK4iTf/wkyvtmBAdnZxnCpJ0KrxUBp+ 7jg= X-SBRS: 2.7 X-MesageID: 10496308 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,403,1571716800"; d="scan'208";a="10496308" From: Andrew Cooper To: Xen-devel Date: Mon, 6 Jan 2020 17:37:04 +0000 Message-ID: <20200106173704.26433-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] xen/cpupool: Fold error paths in cpupool_create() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Andrew Cooper , Dario Faggioli Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The compiler can't fold because of the write to *perr in the first hunk. No functional change, but slightly better compiled code. Signed-off-by: Andrew Cooper Reviewed-by: Juergen Gross --- CC: Juergen Gross CC: Dario Faggioli --- xen/common/cpupool.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c index 4d3adbdd8d..d66b541a94 100644 --- a/xen/common/cpupool.c +++ b/xen/common/cpupool.c @@ -236,10 +236,8 @@ static struct cpupool *cpupool_create( { if ( (*q)->cpupool_id =3D=3D poolid ) { - spin_unlock(&cpupool_lock); - free_cpupool_struct(c); *perr =3D -EEXIST; - return NULL; + goto err; } c->next =3D *q; } @@ -253,11 +251,7 @@ static struct cpupool *cpupool_create( { c->sched =3D scheduler_alloc(sched_id, perr); if ( c->sched =3D=3D NULL ) - { - spin_unlock(&cpupool_lock); - free_cpupool_struct(c); - return NULL; - } + goto err; } c->gran =3D opt_sched_granularity; =20 @@ -270,6 +264,11 @@ static struct cpupool *cpupool_create( =20 *perr =3D 0; return c; + + err: + spin_unlock(&cpupool_lock); + free_cpupool_struct(c); + return NULL; } /* * destroys the given cpupool --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel