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 A2D8BA04A7; Mon, 24 Jan 2022 11:17:36 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 889C2410E8; Mon, 24 Jan 2022 11:17:36 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 1ED2540E0F for ; Mon, 24 Jan 2022 11:17:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643019455; x=1674555455; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=MIPmwCScnNxcbRHy1wyVEZ+jLikfFfoZExs0Q6y93qk=; b=YdylpwYDgoVxEA4OUHzEyT1V+VcfYPrlGWuvfeixIfyikDKEp/6nRpbs mL5b4m/vnSbDi1WP5/hBBoVWvWHk1qLhpoR2SwPYmZ7LPAaBznLI6KdZa HOH8DAk1w0lZ5KY23u3KvTGpv4G8WDMur1vRfUssFeUz1rN09cEM7fBk7 UYIKJbLHqVMuYZxqP4PvfQmXkFXpt5Fn7IYkvprk8fwCyI/hUtMTjw9IL EAJGwd35j0CEk1DRRdgrbEOi64oRmEr+AYoJtoYHzlYRwLcHM0JQJ4zY6 uLcKqNAOOnMfjvvcQogUa9MBsRtbKyXN+me0gpF6cc7aUQLTYMjx/Ozd1 A==; X-IronPort-AV: E=McAfee;i="6200,9189,10236"; a="244848186" X-IronPort-AV: E=Sophos;i="5.88,311,1635231600"; d="scan'208";a="244848186" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2022 02:17:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,311,1635231600"; d="scan'208";a="479024589" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga006.jf.intel.com with ESMTP; 24 Jan 2022 02:17:26 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 24 Jan 2022 02:17:25 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) 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.2308.20; Mon, 24 Jan 2022 02:17:25 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) 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.2308.20 via Frontend Transport; Mon, 24 Jan 2022 02:17:25 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.106) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Mon, 24 Jan 2022 02:17:25 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JQsfp0PzXyUqJTOhzP6lSVUo+1XAXtmraNRdm57WJCR9b/zIsMuJhSLPDJgwP1CE+FJidZQ4g9Op1PO+fFwOdN/08c2DzhFYURQLiyS5SexZontBkPaTEIFnUuy2qtRsXyjgJSXjXWu5UU7DoWcsYPnrD6ykO/h3ARclHz7+1xfjlXD4H1s5IS9G3hvOHVfVhGc22pZbNiUXTFVnLktszUM4Zi3smgwalJKQ4p8e9ChalHOXxXCjm3ze2LA5S9I/InjFdIohavYJxCAtEilJSQ5JG51HPRoS7edlBT3QsG9dt/CqsSbaWdT4gnEfF5b8jsovTRq7hJdXEVlLtL//vw== 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=tuEkqCddt5Yzv/ID7uPd2kvfvVPCFgsS8bKCvcUZ8Xo=; b=Dt37wpK05BXDVf8FkuLPScXqBNcNQ2C5R1dSkVxMFCXmFQDAxG29qljfUSvQqdpcLGsDPfKupUzspAWm150FNBeOauZv6EtlCc7sEc3N3xBi27ztydtF9opZ7zZUHU0jxa9yyLyJbsnpcFYHHyBQXdghEexyQhS2vMgLKN27dGMors2vtQOqVcOLqmwfWQVXtLF+36HGvyZokzGzJmt90na/R850w15QEy4dL6cIbKT54oPaLBqBlUa9faQw2w/GESXTDNRkTan0fnjr6Vpu7vWy2huQQ/+Mbf7XEJUbH9TMxDVkEBdCorJZi6Vk4gVNzN3EVaAV+C9gTaDHz28LkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from DM8PR11MB5670.namprd11.prod.outlook.com (2603:10b6:8:37::12) by BN7PR11MB2545.namprd11.prod.outlook.com (2603:10b6:406:b0::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Mon, 24 Jan 2022 10:17:23 +0000 Received: from DM8PR11MB5670.namprd11.prod.outlook.com ([fe80::e9b0:843e:2b39:6680]) by DM8PR11MB5670.namprd11.prod.outlook.com ([fe80::e9b0:843e:2b39:6680%5]) with mapi id 15.20.4909.017; Mon, 24 Jan 2022 10:17:23 +0000 From: "Dumitrescu, Cristian" To: Stephen Hemminger , "dev@dpdk.org" Subject: RE: [PATCH 05/82] examples/ip_pipeline: remove unnecessary NULL checks Thread-Topic: [PATCH 05/82] examples/ip_pipeline: remove unnecessary NULL checks Thread-Index: AQHYELYdgcU9VyaWG0elBlwWse6yW6xx826Q Date: Mon, 24 Jan 2022 10:17:23 +0000 Message-ID: References: <20220124000518.319850-1-stephen@networkplumber.org> <20220124000518.319850-6-stephen@networkplumber.org> In-Reply-To: <20220124000518.319850-6-stephen@networkplumber.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.200.16 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b306b450-5e3b-4492-3b1a-08d9df22b6c5 x-ms-traffictypediagnostic: BN7PR11MB2545:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: N+mLxwOtcUUBxySiebWuzHfCHPvqhBqb5AYh307WoAlsU5QmwJFOnZCBooBzkxEB+HKYEbEjl3nVqi/DyHQ9GLFquCLnu4czXsmUWjpOVt8/H1hUnCbXpQR0G7kj5mhubqmMgYKZRPJyLBRa2MzR1LeUdM4pM6bme4j/dYd3sw3Emb/4uRSMFt7w/jAoDqWWAOw73PXVcxCQmhTuMtbSC/xPh+hMN1y1QK2FTFbE1za7BNXW0LAteYMJU5alOFM+hWgNWUMLq430CPFa5PU4C7PKTRWkDv7Xc7cRpMKbrf/UMjyWBZ/xLtPyu+TBah3uxOwWXH+JOzDT9kkRbT91PVV3WU27CH/2Cgv8DuKke20LeWmu7eQbb7C9G5sttq8IFwDtF02uB2TDOmUd9WfPyEXOj7ExQUlKAvGW+ANUkwZZ/oFXQZV7vWKPDPs9vKnHqaxOYkJu9X80SmgKct9WjODPPMdklgxQdsuVsa2RnIu45xiGYKrAls9LQ0tw3kDBYW+pVi8JCbyfGBBG9PjeQZ/Fp+wPxFjCW6weyfeg8ZYozqh++QFL5YSLciOCv82B1mpyhspwzhi1huLq86HD+YH6z1zebGVoYseUAITRmS1oiS3ZRqrcNyILHFRBrR22AwVrQZMFfOizj7I2LNfZ933jg1alvbk+9vSXXINTCB/MXkXFJ+bLhoLM5voiRHrJ6J3HFE01gVNTdFd1lTVpiQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM8PR11MB5670.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(26005)(82960400001)(38070700005)(33656002)(5660300002)(55016003)(508600001)(186003)(52536014)(6506007)(86362001)(8936002)(9686003)(76116006)(66946007)(71200400001)(8676002)(316002)(53546011)(110136005)(64756008)(7696005)(83380400001)(122000001)(38100700002)(2906002)(66446008)(66476007)(66556008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?+Se1731E9mwyLwdW28Imy3Zk+pJoDivOtYvWPIQH54onGvyG0EwwjiXwSLbo?= =?us-ascii?Q?wi3IkdTwP6NsS5UiDNlpVXoLaYj7kdF9il/LGN4iuSjZag+LPc2lFZexqhQk?= =?us-ascii?Q?8GnKkq+qsXH7pmixwtwg4om/wM2twjUawlh7R1CVVgdYdXOop30YOnXLCUW3?= =?us-ascii?Q?pb5LhpEWzZWezIg2fG3jatzQ27YPzRJE1amFmbLVQ4v4KCx6hi+DvvMWnPZy?= =?us-ascii?Q?mPxZBh/aGW1LN8aPJzlLzYUhke9WRqZtE3oylcq8E0zXuIfu1Yqh9cdLiv91?= =?us-ascii?Q?SH8igBlV1cuGvpJBZEwuxHK/n0SUqDRJD6F6yLNRlu95cO7poMLAQd+hwbKl?= =?us-ascii?Q?GkEVVsjXIiFR+r0npcTH4LA+u6q9lLNtfBWfbdpNL1EtMXJNE3v/p9hOhFmt?= =?us-ascii?Q?xWR1JaB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?us-ascii?Q?YKgcWsiATRhYLuqWQ83bTrisXuCWj6ygYcvEe0sg7QX5KAm8OpubpNBarYwE?= =?us-ascii?Q?iEAwYgzP6fs4j5dhrY45j2shQzCTdsgfhTS4EYualFHKZ+jsmJyQ+dqv7otd?= =?us-ascii?Q?Vb9SsH+8fxonKEoiEJTbwT//MfJkPJtkOtKGfHwnhuIl1nRc3LZBZbyJqPil?= =?us-ascii?Q?GWxa37bJoXi7cvzDHQ+OZXJk6X3SMtDiy4O+jukCJqYmhf4+w3Jk1QBGYHpB?= =?us-ascii?Q?5wOE1+SP5MsC5RDPxJ1xdKpPwrw6jFmFlRS5U34VbM7uijcDcN3LyZShSS/7?= =?us-ascii?Q?bBqlJI0dvhvaA0GCiGIjunY23kxer4XL0I6vI/OsLctVhKuG2BOlO+JgKRlu?= =?us-ascii?Q?Enu/Ug=3D=3D?= 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: DM8PR11MB5670.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b306b450-5e3b-4492-3b1a-08d9df22b6c5 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jan 2022 10:17:23.7115 (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: DCS9x8CLeB0StlaakumWW8unJzZIoytDRsER886AwUwf6j8r4ClF3l+MhurezcfVj1xwIO2seiKKnCcpJrG9oLpkEWAfSWzXyFag52nJmGg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR11MB2545 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 > -----Original Message----- > From: Stephen Hemminger > Sent: Monday, January 24, 2022 12:04 AM > To: dev@dpdk.org > Cc: Stephen Hemminger ; Dumitrescu, > Cristian > Subject: [PATCH 05/82] examples/ip_pipeline: remove unnecessary NULL > checks >=20 > Remove redundant NULL pointer checks before free functions > found by nullfree.cocci >=20 > Signed-off-by: Stephen Hemminger > --- > examples/ip_pipeline/cli.c | 12 ++++-------- > examples/ip_pipeline/cryptodev.c | 6 ++---- > examples/ip_pipeline/thread.c | 6 ++---- > 3 files changed, 8 insertions(+), 16 deletions(-) >=20 Hi Stephen, The rte_ring_free() and rte_mempool_free() do not state in their API descri= ption that freeing a NULL pointer is harmless. Before pushing these changes= , please add the necessary note in the API header files for these functions= . In the absence of the clear note in their API description, the user is forc= ed to check for the NULL pointer. I agree that the implementation of these = functions does the right think and exits early when the input pointer is NU= LL, but there is no guarantee that the implementation is not going to chang= e. Agree? The stdlib free() and the rte_free() do have the clear API description note= that freeing a NULL object is harmless, so removing the NULL check before = their call is indeed safe. This stands for all the patches in this set. Regards, Cristian