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 1FB9CA034E; Sat, 12 Feb 2022 12:09:43 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 96A9F40395; Sat, 12 Feb 2022 12:09:42 +0100 (CET) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id 3733840140 for ; Sat, 12 Feb 2022 12:09:41 +0100 (CET) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 7DF505C011C; Sat, 12 Feb 2022 06:09:40 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sat, 12 Feb 2022 06:09:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; bh=QAXy8nsM8FCAYJ u5SEpzGyEcJmO4p+IXUEHMw3Jgqr4=; b=grhQ7xCSyVWXzWvhQ0BIZgPS+Ce5d5 DORYArPdIaKuUb1Nr7VIMUFsVk+tnnsoUqiJ2FDXrdULyvdW73HXpqTg2ABZiVDh GBzYAiCImGUs6cFzJECHBw5YPTm8RXioEuHGY+yNzvKG1eMh+z4HHdm+vOjnM3xb T508W6YQiYZR+TCSKBgI0giYko9c9LLuKDtkyHLcYyE8+5/YKIzJltX8SWdp6nqK KqviGV0zmvz+uj8G7lj/ThUMxCt1bYINu17EFZPmSidNcYhqPCu+j8iPFXrk2anH rA0dUpX9addPzRqoDupC5OrduVjk7smX4lWLfoGKJr40tr+P3oZkqhbQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=QAXy8nsM8FCAYJu5SEpzGyEcJmO4p+IXUEHMw3Jgq r4=; b=md1FkDm+x5Kj84k31nxfQkS8RamztoBs1QImpZOAOuSCo30Kbfgctwg8o GXkLZMcnfbVcDaY4lPK9X+hq3FDAcF8S4S0xJFkHAJ6shghEfX4sfCQesmLvYzmf eg1m0UFjmFldy3yKaZu+lp3pvy/uP/z8t0YuwUnVvKFsk77+vMfsmFyDydSw9vjf iWAtQ7ntV+r3BtD3ni/i+iZwDenflj2+5qf42CY+4pEo3o54hckTENMqkeGjBZKD ITRfhUqS34NELBc3+wAztQjJ35cc+lTE5kw41ovKh4LNEIgiujhxQaUgUYop3fAE uSiUipyuxMH4gUjHfKqO6nOF9IoZQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrieehgddvfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei iedvffegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 12 Feb 2022 06:09:39 -0500 (EST) From: Thomas Monjalon To: Stephen Hemminger Cc: dev@dpdk.org Subject: Re: [PATCH v3 00/36] remove unnecessary null checks Date: Sat, 12 Feb 2022 12:09:37 +0100 Message-ID: <1819360.1xdlsreqCQ@thomas> In-Reply-To: <20220209191748.377729-1-stephen@networkplumber.org> References: <20220124000518.319850-1-stephen@networkplumber.org> <20220209191748.377729-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 09/02/2022 20:17, Stephen Hemminger: > While working on a new driver, noticed that some drivers always call > free routines (correct) and others conditionally call free routines > if not null (redundant check). The extra if(e != NULL) type check > is unneeded and adds extra code. Better to have all the code > consistent. > > The Linux kernel has automated this kind of fixup using coccinelle, > and this patchset creates a coccinelle script to do the transformation; > then has individual patches for each sub component. There are probably more functions to check, as suggested by this command: all=$(git grep -ho 'rte_.*_free' lib/**/rte_*.h | sed '/[( ]/d' | sort -u);\ checked=$(grep -o 'rte_.*_free' devtools/cocci/nullfree.cocci | sort -u);\ printf "$all\n$checked" | sort | uniq -u Applied, thanks.