Received: by 10.223.185.116 with SMTP id b49csp1725884wrg; Thu, 15 Feb 2018 00:04:51 -0800 (PST) X-Google-Smtp-Source: AH8x225trnvYFUk5tqn1Hv4zue2iyxiCb4Qhl6kW0g7+e+PBZytdh8wXZtHb4sCqbRv/bCrBBdWx X-Received: by 10.99.140.29 with SMTP id m29mr1564720pgd.320.1518681891329; Thu, 15 Feb 2018 00:04:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518681891; cv=none; d=google.com; s=arc-20160816; b=xhIpXcj0vTvNTiHUzQmg7jlt+kNxU4k3Ycdy4F0UX93nJu2UxFczvR8aCWUd7jVAqk c5XDSFN7ywzG+JmdAsQIYTDnIuOzdZxo7TS6nIP9X5TVV6k6y1x533QjOSvA836ugIS2 mh+b1rcZVOO0BfWgjvpi9PqF3jUSSPJswZwC7v1AuA8KXa+Ff0weOhTEv+nOJQ1MyB48 695Qz2JDjXeCwUncwbxCmg2kXCCDkePZnOX0W82FFcRl8T/NYxPzvY44tUetG4Dc6iaL 9zoXctYSa4kyG0FRxlbjmn68W/b9mR/60oMGWHTCesFB99euCdK07qK883ozdq2cipWg 4khg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=/Pk12pQDZUPSqHo+T0E5ikrls6LDBwFP5i0kdrCp+Uw=; b=ffEVz0dxglUzePU5jk7Rfp4GGd0NR3LDJWlr8SecPcKJ8JHQDWIVLjgvQX5JLe9SB8 1rmEEEsEl3NdHn55PbdbbRtkJhPZbJ4SRLll8Mv5qPWIGJbZOraeA3yUfwXfOE8limHa +Q/IeZ6FYbfblsCWDzqXPDDBcxmF2BKmrr1RXevdYYgq6BduaLAoid7ySguX3OrPoOe4 O9CPd2njnnaG6ma0iTP3FcalAOKsbqNsKTezc66cBcH2TERmWPSXtHDySt0I/zCHU+Y8 lT49tUA+T1amkg5K/agbjxTV2ZcQJfRuFjFLNFgpppGgkShi1leIVpWNyKsGwsFc6fgC /SLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=UnQlGxrl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e9si540430pgt.828.2018.02.15.00.04.25; Thu, 15 Feb 2018 00:04:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=UnQlGxrl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754995AbeBOIDk (ORCPT + 99 others); Thu, 15 Feb 2018 03:03:40 -0500 Received: from mail-eopbgr10057.outbound.protection.outlook.com ([40.107.1.57]:11919 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754864AbeBOID3 (ORCPT ); Thu, 15 Feb 2018 03:03:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=/Pk12pQDZUPSqHo+T0E5ikrls6LDBwFP5i0kdrCp+Uw=; b=UnQlGxrl3R5jhfBnaKwph1hPlaUPLjtSRi9IU9cl4jCjKXeBRr/iWK7olN05AcseRmLDCUoF4+aVNgkWn0lW6fnnpgFcvV0qmhywLbEgwD8hn1WmJ73Z42riQ2MZ64aSmV6aGdwUl8f4S7MABfaCrJ7WVMOnXFaENrIx/QJNezA= Received: from VI1PR0402MB3342.eurprd04.prod.outlook.com (52.134.8.142) by VI1PR0402MB3486.eurprd04.prod.outlook.com (52.134.4.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Thu, 15 Feb 2018 08:03:25 +0000 Received: from VI1PR0402MB3342.eurprd04.prod.outlook.com ([fe80::c00:390d:e182:6900]) by VI1PR0402MB3342.eurprd04.prod.outlook.com ([fe80::c00:390d:e182:6900%13]) with mapi id 15.20.0485.016; Thu, 15 Feb 2018 08:03:25 +0000 From: =?iso-8859-2?Q?Horia_Geant=E3?= To: SF Markus Elfring , "linux-crypto@vger.kernel.org" , Aymen Sghaier , "David S. Miller" , Herbert Xu CC: LKML , "kernel-janitors@vger.kernel.org" Subject: Re: [PATCH 2/2] crypto: caam: Use common error handling code in four functions Thread-Topic: [PATCH 2/2] crypto: caam: Use common error handling code in four functions Thread-Index: AQHTpcI0b4HOP9UH+0eRDkH/e5usGw== Date: Thu, 15 Feb 2018 08:03:24 +0000 Message-ID: References: <9a9a602d-93da-457d-c37d-2acbb4b7b5d5@users.sourceforge.net> <3c2905a1-b3a4-be87-618e-8562d3a5d8b4@users.sourceforge.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=horia.geanta@nxp.com; x-originating-ip: [192.88.166.1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR0402MB3486;7:WftbtBPkZWnSO1QL64hD5JE++emBT9pxu/8JfOCRSDhjE/ZQIf2r0kxUEcZl+Gk134Hkkw8tvSulacg/uRd8d74FyDTmyrEZfdD5tCq9rcxHZoiyM67+2anVamehm+nvTtJ5Ad5hQfcLZD/HDx3gn1DXP31qnNmcg4yHUVRlodtRusvcSTgXaV96GgVU6d+koVnXalZ/f4bQ/zbTpsEVEIarY3qospgo5y/RvlQ5jnMp5Ievv4nrrCvusUgVKQOe x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI;SCL:-1;SFV:NSPM;SFS:(10009020)(396003)(39380400002)(39860400002)(376002)(366004)(346002)(189003)(199004)(81166006)(8676002)(74316002)(8936002)(99286004)(54906003)(76176011)(81156014)(105586002)(3846002)(6246003)(2900100001)(7696005)(106356001)(110136005)(4326008)(53936002)(86362001)(66066001)(9686003)(5660300001)(68736007)(53546011)(478600001)(305945005)(3280700002)(33656002)(6116002)(59450400001)(229853002)(6506007)(6436002)(3660700001)(7736002)(102836004)(2906002)(5250100002)(186003)(55016002)(316002)(97736004)(26005)(2501003)(25786009)(14454004);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0402MB3486;H:VI1PR0402MB3342.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: ac49cadb-3cbb-4d18-46d9-08d5744a96db x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020);SRVR:VI1PR0402MB3486; x-ms-traffictypediagnostic: VI1PR0402MB3486: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(42262312472803); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040501)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(3231101)(944501161)(10201501046)(6055026)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011);SRVR:VI1PR0402MB3486;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0402MB3486; x-forefront-prvs: 058441C12A received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: UocwO443bHnqcLPLPhJ/pJCCv3+m0SbDjSg4NA8Jl2myYvv08PecqhR/A+CsG5H/Zf3wawnOO0d7SckSli6Q6g== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac49cadb-3cbb-4d18-46d9-08d5744a96db X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Feb 2018 08:03:24.8585 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3486 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/14/2018 8:32 PM, SF Markus Elfring wrote:=0A= > From: Markus Elfring =0A= > Date: Wed, 14 Feb 2018 19:14:49 +0100=0A= > =0A= > Add jump targets so that a bit of exception handling can be better reused= =0A= > at the end of these functions.=0A= > =0A= > Signed-off-by: Markus Elfring =0A= [snip]=0A= > @@ -1096,6 +1092,7 @@ static int ahash_digest(struct ahash_request *req)= =0A= > if (!ret) {=0A= > ret =3D -EINPROGRESS;=0A= > } else {=0A= > +unmap_hash:=0A= > ahash_unmap(jrdev, edesc, req, digestsize);=0A= > kfree(edesc);=0A= > }=0A= > =0A= I understand jumps are a necessary evil for dealing with shortcomings of C,= =0A= however please avoid jumping in an if/else branch.=0A= =0A= Code could be rewritten as:=0A= =0A= if (!ret)=0A= return -EINPROGRESS;=0A= =0A= unmap_hash:=0A= ahash_unmap(jrdev, edesc, req, digestsize);=0A= kfree(edesc);=0A= =0A= Thanks,=0A= Horia=0A=