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 74A3AA034E; Wed, 9 Feb 2022 20:18:01 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D182F41150; Wed, 9 Feb 2022 20:17:56 +0100 (CET) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mails.dpdk.org (Postfix) with ESMTP id 7CCF640140 for ; Wed, 9 Feb 2022 20:17:53 +0100 (CET) Received: by mail-pj1-f45.google.com with SMTP id h7-20020a17090a648700b001b927560c2bso1992775pjj.1 for ; Wed, 09 Feb 2022 11:17:53 -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=rwS5O7CUkeznCJ2KMEgUESwVJe2yFihus5oUAtdxrOs=; b=8QR4dfHbG4cvLZWMBT4BerPYQnqpwfMunh55HFsFq9p7vFNL9GcKoEeB0hBOZP4yMO 6dG18AKxzhA9GxO5T6MmZYBh5C6GaliYw1s9dUJxntvSHhGOk5J4vMuYT42dG9HazGk3 nKQT6TIh8A6hU/qXD+PRvJdOerFietod2uYMyHFZ9KQEDcB/CB+kqzu+Xu7hXlZ27tWE /gSEQ+q4RXaSQhY2e6DLc8YygTVppdBLnlN5zkyEGY1HBZ2oxv3eGgaWgg+UOgGxQvNj 9eeoXjnRiJGFiIve2DKYYvcJ4DOQH5XFC0RLi5A2Z1Jq7thgJemG6nWboFb9HnRJIr0U ++lA== 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=rwS5O7CUkeznCJ2KMEgUESwVJe2yFihus5oUAtdxrOs=; b=QocPwkwMfc+Qc5K5H1p62QOZLdfm2fuPieLLQvwQQJa74Kj7zeVBEQBqs/Y6Fr3zOz k6ypsFCMAJqzcEwyIpM5m8Ww8Xr7mmCZId1gxKrJnMsli66zspmD6pX+jGQkB09yvNwE tdgEzgt7UNehr2ZJp/OX2DWoyP2S5FcKRCsjrJsQnLfICs2NYGrmxGpT/dkRGoC+MgRS ZQ6gtQ82leNCYsp6d38Kke9OhOI/DcmVQabF1YxdI2BP/WPitqGCY1bloz6XvUjINMS4 okaZvDg13XyCID5S9uxcAX8fqlS6H/BTX2sD+SHKGNuqszDdVBbgjpdTIYjQiZpMdBmR u03g== X-Gm-Message-State: AOAM532Jt0Wa9dfdagobXv5sqLhIpNM2jMQFIj/caj6U9jnZFIww0xkD qfqWaW/g86wNuvNrXZJaaY3lWGgjFidkZo+h X-Google-Smtp-Source: ABdhPJwt9Rl/iI+iXcV7sW3sY3IclsH8vQfnqFMDIieubrctKfTCnZ26u79Fbj4ucQmCmTF/nHgysQ== X-Received: by 2002:a17:903:244b:: with SMTP id l11mr3595024pls.151.1644434272351; Wed, 09 Feb 2022 11:17:52 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id u16sm14378401pgh.54.2022.02.09.11.17.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 11:17:51 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin , Olivier Matz , Andrew Rybchenko , Honnappa Nagarahalli , Konstantin Ananyev Subject: [PATCH v3 01/36] lib: update documentation of XXX_free() functions Date: Wed, 9 Feb 2022 11:17:13 -0800 Message-Id: <20220209191748.377729-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.34.1 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: 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 These functions all behave like libc free() and do nothing if handed a NULL pointer. The code is already doing this, this patch just documents the behavior. Signed-off-by: Stephen Hemminger --- lib/hash/rte_hash.h | 4 +++- lib/mempool/rte_mempool.h | 1 + lib/ring/rte_ring.h | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/hash/rte_hash.h b/lib/hash/rte_hash.h index 6067aad95431..7fa9702742a9 100644 --- a/lib/hash/rte_hash.h +++ b/lib/hash/rte_hash.h @@ -174,8 +174,10 @@ rte_hash_find_existing(const char *name); /** * De-allocate all memory used by hash table. + * * @param h - * Hash table to free + * Hash table to free, if NULL, the function does nothing. + * */ void rte_hash_free(struct rte_hash *h); diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h index 1e7a3c15273c..1d3cdf7f2209 100644 --- a/lib/mempool/rte_mempool.h +++ b/lib/mempool/rte_mempool.h @@ -1101,6 +1101,7 @@ rte_mempool_create_empty(const char *name, unsigned n, unsigned elt_size, * * @param mp * A pointer to the mempool structure. + * If NULL then, the function does nothing. */ void rte_mempool_free(struct rte_mempool *mp); diff --git a/lib/ring/rte_ring.h b/lib/ring/rte_ring.h index ab6b4244c89e..980e92e59493 100644 --- a/lib/ring/rte_ring.h +++ b/lib/ring/rte_ring.h @@ -193,7 +193,8 @@ struct rte_ring *rte_ring_create(const char *name, unsigned int count, * De-allocate all memory used by the ring. * * @param r - * Ring to free + * Ring to free. + * If NULL then, the function does nothing. */ void rte_ring_free(struct rte_ring *r); -- 2.34.1