From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EFA91A00C4; Mon, 14 Nov 2022 16:43:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9A9ED40150; Mon, 14 Nov 2022 16:43:43 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id A00C24014F for ; Mon, 14 Nov 2022 16:43:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668440621; x=1699976621; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=7HaqtP1C06QvLbvfmK0wKuJiDp0w1GmqFFc3az4ZJBY=; b=jKoFYwJaSbK0ZQSmecysDlki1vSh2U1L+VYsZsbIpcH9NV9pMn1LG1I2 kehSWKNynXJJD3T8zDICJJKp+R2rSSHdwTzlAkxz69PhvowB2XvD+Blpe l6oETahN7NVa5AvsUhi/dicr0/U3NRH3LXfdFOftRuQF6Yuck7nXg/pUk zqShSnzhec5wPce+BmLTXnvUt/rIQidjahlvMxmbqt9hZGnQGHcXFoY88 4FXjHyGVjWKga01v2m0g0QeKl8TfCiNU664ENrIzCaCp+xsWIfZmd8m35 dgIjs6VuXITGEqnZvf5nZD8Ff0hwAqpoSHCh2zDnEutTJq5PR0w1Ip6uE A==; X-IronPort-AV: E=McAfee;i="6500,9779,10531"; a="313148216" X-IronPort-AV: E=Sophos;i="5.96,164,1665471600"; d="scan'208";a="313148216" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Nov 2022 07:43:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10531"; a="632848540" X-IronPort-AV: E=Sophos;i="5.96,164,1665471600"; d="scan'208";a="632848540" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga007.jf.intel.com with ESMTP; 14 Nov 2022 07:43:40 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 14 Nov 2022 07:43:39 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 14 Nov 2022 07:43:39 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Mon, 14 Nov 2022 07:43:39 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.100) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Mon, 14 Nov 2022 07:43:39 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A32Wp7Op2H7sRhkLXln19Bef5N4HITZN6UDYTdYosHYqeabnTX5Lk/0DXSO/dyqoPDTWgtR+PLSteXgSvoAjfdyeLvlJOKIAasBOC8n+nj0lzqoSTM4JgPg1kOlrvrJlsf5G3ZmOEVkiHDs8UEtAuQf/oLGDkVNofA/iRoy9UN6f/AHkmnbkdQ87NY4B1BGMXiuDhFjgplY3Z6Vz0c/qUXVpQ04aYqIxaZAwqP3030hD5Gtv3QEYITmrijgyYetHj/qM1n+1qe3wo7+RI3ygkP9F2hMXTTU56BxGM695m6ONvLtGXZc0HPGjk30PfMe/Y2yibkR00cw18Keq8pYnbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=A/+8lfPVRmQKZk101s8NF0r61PfeeGFgDYvXDPPAKVI=; b=hOil7d+LFCojL6cQ9TwBlQ9IHdddMwL2tGds5lcpW+7MX72/vsdDSMLexa33lCqSu/JXBmoXeLAkVfk7u0lmOLpCbe6hnLeys2fmdTRgESyTMT9mqxgW7SvlMFZt5esyQe1Mo/etnM5bycSQCb993VTFsg0U+/tzjWO98/L0fyS9oqLhzKOK6S/dDbtM1lMw/O6GDl8FcG/k6B1ORjlNcJOUVCsnaT+0+AvL2PkhvhOeR0gHjAE9Y0cVZwpjmdc47+/PHVe416Axrw1YwHKeJYd8apmdGHoDXtv/zuOF7gJBw0c3Yana0NA33YDBkp0uSIuKCXG7AmnqYuCDyABrlg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from CY4PR11MB1848.namprd11.prod.outlook.com (2603:10b6:903:123::22) by MN0PR11MB6085.namprd11.prod.outlook.com (2603:10b6:208:3cf::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.24; Mon, 14 Nov 2022 15:43:38 +0000 Received: from CY4PR11MB1848.namprd11.prod.outlook.com ([fe80::f56b:821f:1f15:2f3f]) by CY4PR11MB1848.namprd11.prod.outlook.com ([fe80::f56b:821f:1f15:2f3f%11]) with mapi id 15.20.5813.017; Mon, 14 Nov 2022 15:43:38 +0000 From: "Dooley, Brian" To: Stephen Hemminger , "dev@dpdk.org" CC: "Hunt, David" Subject: RE: [PATCH 4/4] examples: remove unnecessary null checks Thread-Topic: [PATCH 4/4] examples: remove unnecessary null checks Thread-Index: AQHY9JWTyGt30hwhrkiCLJUsGxZNgK4+lT5A Date: Mon, 14 Nov 2022 15:43:37 +0000 Message-ID: References: <20221109234649.331942-1-stephen@networkplumber.org> <20221109234649.331942-5-stephen@networkplumber.org> In-Reply-To: <20221109234649.331942-5-stephen@networkplumber.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CY4PR11MB1848:EE_|MN0PR11MB6085:EE_ x-ms-office365-filtering-correlation-id: cf446caf-17c4-41aa-e52b-08dac656ff58 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: KcYZIsxgXRoDANrrJTHyyDLlGNxIGQcGR+2U/UDVfEeYzFu85Q56Auf+/WQ6NFjA1db4QrjE/COpU44Q0F853VoYTIuvwMJk2Ts66npAIkynxNdhLhSe59cTrpHk2l0zUx2XqDKOoT4ffjZjzMkBoQOzln7DygEr1LgoocntXnuNElAIl+8uH3cjPlDsqX4EHbz9iESyguCA00tzwpIfDHZWTLHwFmT+3KhTRT6YkSQJktLUbBnqUYq6vM33T9BsBPUQIKAgvleZWSqe6mSiXuBTDq0ahDKq1Ew5sSwRkJQi15uyLzHvdV3N0YYTCnEF0jTRDPobFLqTUrxeRkOG52zaJBHwVAR2ikby3BOYy66t/BF94i4HUsIqpoQVnTX2OBh8ZX50Lb2JLlGDTCucCwg35ayMFFubg56J7YjaSvN+6ayKrkfSN3SJDnmHyjhyKXgxqShPrwMqcqS/nwtHggXw+yjiq0GCOgZ2yXHRMnqYzVThYzh95B8kgCgejWjShHRGv+ZMZhoan09kHHVvboTuIb8uCfse8GBXbziEO0k1gKfWrjktiEKhzn7ygBOPYf75O7DXcG9BcWGXSuZViPtjAgNbVkRT6HtDCMT2cxXyUEDDWjrz4r0JDtllAk+WnHeZnzzTOmAZF7HECHLQrBX0IcvVeSS5w44kG0XznskODA7d03ug38J5e/gUKs/E9j6lbz+HJfdVxiFeZ8o/6mwRwZt33ANpUo+KUrxgVlSRDZt4fwq26d7gcCcL1hjnlEyQRq2Yx2vUpFOGZjMUbA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR11MB1848.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(39860400002)(136003)(376002)(346002)(396003)(451199015)(82960400001)(38070700005)(38100700002)(5660300002)(55016003)(86362001)(66446008)(66946007)(66556008)(8676002)(41300700001)(66476007)(64756008)(2906002)(8936002)(6506007)(316002)(76116006)(26005)(52536014)(122000001)(53546011)(186003)(4326008)(71200400001)(107886003)(478600001)(83380400001)(9686003)(7696005)(110136005)(33656002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?DPDZheF4zeoAeuVzGCahrCpWmrolOCJ1AKvM2DRLYJ7s/6XsRvUw3EPhoEaz?= =?us-ascii?Q?PsUvfb+9+4M9rMSNevFyJpIQYAVzO8JewSnK2e+tm/WOhp0ykfG64My74uGN?= =?us-ascii?Q?WhogYCTgtqIzszXAq6H+tnBzhWgyq7/v1YoWb4LKQTDFTJux9td60YR96rEi?= =?us-ascii?Q?urxaekIvsrT7lS150/x66x9eQPynwsv3ostn6I7ouTzVucISC+O/5Mit3Ce7?= =?us-ascii?Q?5kpkBsVfkAIRWQQbfHNndzWQXV0O9cDMqalnwcMAO4DoH+KfomDFhHIy3LAy?= =?us-ascii?Q?ophgK4bC1f7ts+oElCFDPsjJWBppkSUhQKHF/zqSzrMQxB7+JsJ4i+0ZrB77?= =?us-asc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h54iB+zoEnUJlKtxpIwIkx1YNudsW?= =?us-ascii?Q?1xc2C5gyYI9nB6sr2iQksRlLWQcXcUwM8I/24NJlBXeqg5zaA22It4hXfFdv?= =?us-ascii?Q?eKj99h5o1F6o5zQlS2zwocWsNjHLWE+6yMM5IQA4f3n1Xno/1SE5F856mwP8?= =?us-ascii?Q?zDU0/GuzD7/uXN+u+ByK3tDsizyG5TUldG0sfKoMwVLWNQ44rQU6Utj3gSpb?= =?us-ascii?Q?BfKLv7ZIxKV3hHEU2sPLhJlyL/xbAh/Kv/gE5ZJFakC2HEpMliR4sXPAV4vK?= =?us-ascii?Q?u9gXoN9ArOcjx8djAwEW9AcRTqUNmBsvxyBNhKKj0DxT6/iQ30ROnswigVGn?= =?us-ascii?Q?U+Hg0dYadybXsC6yddqdD9gl3B4Yo8BuGhR/cNfx?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY4PR11MB1848.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cf446caf-17c4-41aa-e52b-08dac656ff58 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Nov 2022 15:43:37.9693 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ueD+6sgEzCkgnDo1zV/ZiooyT8tUFprYZTPgN93R53TSgZHE/nEOvq6qNBTCEl6LhS+UQoBrJJ755BLXqbWsIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR11MB6085 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Stephen, Looks good for fips validation. > -----Original Message----- > From: Stephen Hemminger > Sent: Wednesday, November 9, 2022 11:47 PM > To: dev@dpdk.org > Cc: Stephen Hemminger ; Hunt, David > ; Dooley, Brian > Subject: [PATCH 4/4] examples: remove unnecessary null checks >=20 > The function rte_free() already handles NULL argument; therefore the > checks in this code are unnecessary. >=20 > Signed-off-by: Stephen Hemminger > --- > examples/distributor/main.c | 3 +-- > examples/fips_validation/main.c | 15 +++++---------- > 2 files changed, 6 insertions(+), 12 deletions(-) >=20 > diff --git a/examples/distributor/main.c b/examples/distributor/main.c in= dex > e767973ed8de..21304d661873 100644 > --- a/examples/distributor/main.c > +++ b/examples/distributor/main.c > @@ -1017,8 +1017,7 @@ main(int argc, char *argv[]) >=20 > print_stats(); >=20 > - if (pd) > - rte_free(pd); > + rte_free(pd); > rte_free(pr); >=20 > /* clean up the EAL */ > diff --git a/examples/fips_validation/main.c > b/examples/fips_validation/main.c index 40a5b70e073b..73caaffb7e7a > 100644 > --- a/examples/fips_validation/main.c > +++ b/examples/fips_validation/main.c > @@ -962,8 +962,7 @@ prepare_rsa_op(void) > asym->rsa.message.data =3D msg.val; > asym->rsa.message.length =3D msg.len; >=20 > - if (vec.rsa.signature.val) > - rte_free(vec.rsa.signature.val); > + rte_free(vec.rsa.signature.val); >=20 > vec.rsa.signature.val =3D rte_zmalloc(NULL, vec.rsa.n.len, 0); > vec.rsa.signature.len =3D vec.rsa.n.len; @@ -1011,11 +1010,9 > @@ prepare_ecdsa_op(void) > asym->ecdsa.k.data =3D vec.ecdsa.k.val; > asym->ecdsa.k.length =3D vec.ecdsa.k.len; >=20 > - if (vec.ecdsa.r.val) > - rte_free(vec.ecdsa.r.val); > + rte_free(vec.ecdsa.r.val); >=20 > - if (vec.ecdsa.s.val) > - rte_free(vec.ecdsa.s.val); > + rte_free(vec.ecdsa.s.val); >=20 > vec.ecdsa.r.len =3D info.interim_info.ecdsa_data.curve_len; > vec.ecdsa.r.val =3D rte_zmalloc(NULL, vec.ecdsa.r.len, 0); @@ - > 1060,11 +1057,9 @@ prepare_ecfpm_op(void) > asym->ecpm.scalar.data =3D vec.ecdsa.pkey.val; > asym->ecpm.scalar.length =3D vec.ecdsa.pkey.len; >=20 > - if (vec.ecdsa.qx.val) > - rte_free(vec.ecdsa.qx.val); > + rte_free(vec.ecdsa.qx.val); >=20 > - if (vec.ecdsa.qy.val) > - rte_free(vec.ecdsa.qy.val); > + rte_free(vec.ecdsa.qy.val); >=20 > vec.ecdsa.qx.len =3D info.interim_info.ecdsa_data.curve_len; > vec.ecdsa.qx.val =3D rte_zmalloc(NULL, vec.ecdsa.qx.len, 0); > -- > 2.35.1 Acked-by: Brian Dooley