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 5E46CA00C2; Sun, 20 Feb 2022 19:21:59 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E2B82410FA; Sun, 20 Feb 2022 19:21:54 +0100 (CET) Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by mails.dpdk.org (Postfix) with ESMTP id 72D7340395 for ; Sun, 20 Feb 2022 19:21:52 +0100 (CET) Received: by mail-pl1-f172.google.com with SMTP id m11so7604259pls.5 for ; Sun, 20 Feb 2022 10:21:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MkNXUUiZPIU2HM85TN+00W31datUK0jxa0w2IpiHT7g=; b=HASJX05c05doK/Oci8P+AGWLnvxVRH316+8SEo8WGudT6Gz/PSJnseRZpFJgMpMqim nKH14Z25BiM71k+AwFOqb3td4ATEMJBGBaE879+KL2wxBwDwbXKV/8GzTm4zMoojhyB6 vX4sKySI646qE68LZZj9NMfWlTYaQy3Ou6DJQNITwurx6v0S9oFKkuXRlUcRVIidcQTE buTDGexvdrYGl8/bb9biqfGtBpAXyZyEI6pFXPpDYluSlLZXJqCjUDAuXpcG2w23ISqu 48xcC853phJjWEL/sJkDeQ53uGpA6AFqSkMug8XZy1qqfcxZgqWeydKYI4OrLO1x/mwV MKkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MkNXUUiZPIU2HM85TN+00W31datUK0jxa0w2IpiHT7g=; b=ZXYJLSyVbVkUgTx3iPVDa6XogdVftxShm1hKGV/VtNSM/i/Zx3kUv0RxHqdseZI9AN FRHeMWBK8gUq3Baf3Uan35M0BlUkP8Fa9Po7WreKV1QmF6mkLyOQaHpB17XzBlJTXTfK JY3Pt2FfbrNwbw7sYmzMCzEXRAOWX9BaBoeSNNP61DbPTwiFR7nRbu8S4sJmornISaph 0Wip9DdpnQNiGVfa0ULG/wt4gk41Mx1Wm+jWvHJGsHti/thjagEhZWyF0aCcjR8onTep PY5qebN35QNvUMd8asJooajregHj1fh58WrIgTvObmkfxOeUk2CgTTdMxtsHf6KtgSJG J9ag== X-Gm-Message-State: AOAM530iPFetfSlGzmRZp3BsSvGGCgXMLPmJIB2nPMwZu1iMVs1pTGoQ D9CS84xrMAj54RSTh7L6JecBGHoY2yIqfCQQ X-Google-Smtp-Source: ABdhPJxMzWJrPV7nYaW5ULnrFmJCxsuHf5DlL/iZ5/Rtg/Kzwcjsf/XeUdYWAAZZiJyuB0u7eTqdQA== X-Received: by 2002:a17:90a:6404:b0:1b9:28a8:935f with SMTP id g4-20020a17090a640400b001b928a8935fmr17975154pjj.197.1645381311135; Sun, 20 Feb 2022 10:21:51 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id u8sm13528107pgf.83.2022.02.20.10.21.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Feb 2022 10:21:50 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v3 1/8] cocci/nullfree: add more functions Date: Sun, 20 Feb 2022 10:21:40 -0800 Message-Id: <20220220182147.9750-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220220182147.9750-1-stephen@networkplumber.org> References: <20220219234322.61309-1-stephen@networkplumber.org> <20220220182147.9750-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 There are more functions in DPDK which have the semantics as free() when passed NULL pointer. Also, put the checks in alpha order. Signed-off-by: Stephen Hemminger --- devtools/cocci/nullfree.cocci | 108 ++++++++++++++++++++++++++++++++-- 1 file changed, 102 insertions(+), 6 deletions(-) diff --git a/devtools/cocci/nullfree.cocci b/devtools/cocci/nullfree.cocci index 363b6149ac28..9ca3fc286497 100644 --- a/devtools/cocci/nullfree.cocci +++ b/devtools/cocci/nullfree.cocci @@ -7,27 +7,123 @@ expression E; @@ ( +- if (E != NULL) cmdline_free(E); ++ cmdline_free(E); +| - if (E != NULL) free(E); + free(E); | +- if (E != NULL) rte_acl_free(E); ++ rte_acl_free(E); +| - if (E != NULL) rte_bitmap_free(E); + rte_bitmap_free(E); | +- if (E != NULL) rte_comp_op_free(E); ++ rte_comp_op_free(E); +| +- if (E != NULL) rte_crypto_op_free(E); ++ rte_crypto_op_free(E); +| +- if (E != NULL) rte_efd_free(E); ++ rte_efd_free(E); +| +- if (E != NULL) rte_event_ring_free(E); ++ rte_event_ring_free(E); +| +- if (E != NULL) rte_fib_free(E); ++ rte_fib_free(E); +| +- if (E != NULL) rte_fib6_free(E); ++ rte_fib6_free(E); +| +- if (E != NULL) rte_flow_classifier_free(E); ++ rte_flow_classifier_free(E); +| - if (E != NULL) rte_free(E); + rte_free(E); | +- if (E != NULL) rte_fbk_hash_free(E); ++ rte_fbk_hash_free(E); +| +- if (E != NULL) rte_gpu_mem_free(E); ++ rte_gpu_mem_free(E); +| - if (E != NULL) rte_hash_free(E); + rte_hash_free(E); | -- if (E != NULL) rte_ring_free(E); -+ rte_ring_free(E); +- if (E != NULL) rte_intr_instance_free(E); ++ rte_intr_instance_free(E); | -- if (E != NULL) rte_pktmbuf_free(E); -+ rte_pktmbuf_free(E); +- if (E != NULL) rte_intr_vec_list_free(E); ++ rte_intr_vec_list_free(E); +| +- if (E != NULL) rte_kvargs_free(E); ++ rte_kvargs_free(E); +| +- if (E != NULL) rte_lpm_free(E); ++ rte_lpm_free(E); +| +- if (E != NULL) rte_lpm6_free(E); ++ rte_lpm6_free(E); +| +- if (E != NULL) rte_member_free(E); ++ rte_member_free(E); | - if (E != NULL) rte_mempool_free(E); + rte_mempool_free(E); | -- if (E != NULL) rte_kvargs_free(E); -+ rte_kvargs_free(E); +- if (E != NULL) rte_pktmbuf_free(E); ++ rte_pktmbuf_free(E); +| +- if (E != NULL) rte_rib_free(E); ++ rte_rib_free(E); +| +- if (E != NULL) rte_rib6_free(E); ++ rte_rib6_free(E); +| +- if (E != NULL) rte_reorder_free(E); ++ rte_reorder_free(E); +| +- if (E != NULL) rte_ring_free(E); ++ rte_ring_free(E); +| +- if (E != NULL) rte_port_in_action_free(E); ++ rte_port_in_action_free(E); +| +- if (E != NULL) rte_port_in_action_profile_free(E); ++ rte_port_in_action_profile_free(E); +| +- if (E != NULL) rte_sched_port_free(E); ++ rte_sched_port_free(E); +| +- if (E != NULL) rte_stack_free(E); ++ rte_stack_free(E); +| +- if (E != NULL) rte_stats_bitrate_free(E); ++ rte_stats_bitrate_free(E); +| +- if (E != NULL) rte_swx_ctl_pipeline_free(E); ++ rte_swx_ctl_pipeline_free(E); +| +- if (E != NULL) rte_swx_pipeline_free(E); ++ rte_swx_pipeline_free(E); +| +- if (E != NULL) rte_swx_table_learner_free(E); ++ rte_swx_table_learner_free(E); +| +- if (E != NULL) rte_swx_table_selector_free(E); ++ rte_swx_table_selector_free(E); +| +- if (E != NULL) rte_table_action_free(E); ++ rte_table_action_free(E); +| +- if (E != NULL) rte_table_action_profile_free(E); ++ rte_table_action_profile_free(E); +| +- if (E != NULL) rte_tel_data_free(E); ++ rte_tel_data_free(E); +| +- if (E != NULL) trie_free(E); ++ trie_free(E); ) -- 2.34.1