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 96F72A00C2; Sun, 20 Feb 2022 01:51:51 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE59E41104; Sun, 20 Feb 2022 01:51:48 +0100 (CET) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mails.dpdk.org (Postfix) with ESMTP id 68D924014E for ; Sun, 20 Feb 2022 01:51:45 +0100 (CET) Received: by mail-pj1-f48.google.com with SMTP id y16so3564506pjt.0 for ; Sat, 19 Feb 2022 16:51:45 -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=anItR6KFA+9+sIVGR/TKu9iEdVKIL5VDhmPHijptnwk=; b=1VX1SBtVEvLmNRSD0MvEcqgtXBZGD4gVD3KfhlwZT7iLBcB/k19cq2Fy3ZFfgOYZ4/ qQAwGYbWw/ZLZJXiwLYa2gYwhazFUbwu2wI85i6ekgJv/WMgu+g8WDVpXko5UVQRjlpH LFymzOvGiJhNdWS7wUZXBAzLV3gmGvnDTA3zvgVp329GMYguUdvL5OYBAM8H9xssLOKa 457IlQL2ASihB1OcE+Y5S92kXrBQf1Ycaj9CIt3lEGkk7Ok5P4Y0IGZz4d8VVJVXw+Rc lkz9B3BhVuxmMXgkniqffYrYclwT6n2RpEKpsJ+5kabaYiW2UPBhSoyitqexEE7bM5pW aTAA== 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=anItR6KFA+9+sIVGR/TKu9iEdVKIL5VDhmPHijptnwk=; b=bi9H/Aj/+JAtKVvES3vSGdsxp4KPvok/FZuOplVNeX5nxdoxtVP/Ar+LD65mj3vkk4 ZgjGX9Qu706Aq3Np22dO40LgR4OLW9TIJ+DtnAPRKXW9wqcQgLCfTaOMNhJjvzIz75z5 mCuukswmC2aY4O/08b43ge0MkyzZCWMV3pbg79GMg1eR2b55uO9GxKmvWpp8BfI3phs6 zpZnFbx8JOhSovtXDIgbhTGDIzGDjPHoWTYeZVTwR1qSvpRyOH1hS+M6/vZcbgjGFU3N Cu/+hVFRJAyVGGdkkEwAnITgjbnGKY6mk6LoEfH4+ZnftA3klSuEDl+pSvilfjpErB+D onlg== X-Gm-Message-State: AOAM531RQ9MUydW2s1+8RgSZdit59k24C3mbmMrp2/rTRtIged4MOrwT WuVZ8sa/FmKJmpUhi+I+fRIIlZ6Yy7ApfiBV X-Google-Smtp-Source: ABdhPJyZ4TdDSdtcKdctANYz2LvB5uup2WCaAWqlr4bwKaNwCZSjdAQsTWE6GYB4uImZWeaySXjv3w== X-Received: by 2002:a17:90a:d786:b0:1b8:bd2a:d804 with SMTP id z6-20020a17090ad78600b001b8bd2ad804mr15034387pju.245.1645318304127; Sat, 19 Feb 2022 16:51:44 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id f7sm8129695pfc.0.2022.02.19.16.51.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Feb 2022 16:51:43 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v2 1/7] cocci/nullfree: add more functions Date: Sat, 19 Feb 2022 16:51:34 -0800 Message-Id: <20220220005140.78713-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220220005140.78713-1-stephen@networkplumber.org> References: <20220219234322.61309-1-stephen@networkplumber.org> <20220220005140.78713-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 | 63 +++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 6 deletions(-) diff --git a/devtools/cocci/nullfree.cocci b/devtools/cocci/nullfree.cocci index 363b6149ac28..a1e6be4b3b14 100644 --- a/devtools/cocci/nullfree.cocci +++ b/devtools/cocci/nullfree.cocci @@ -7,27 +7,78 @@ 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_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_ring_free(E); ++ rte_ring_free(E); +| +- if (E != NULL) rte_stack_free(E); ++ rte_stack_free(E); +| +- if (E != NULL) rte_tel_data_free(E); ++ rte_tel_data_free(E); ) -- 2.34.1