From: Stephen Hemminger Date: Wed, 9 Feb 2022 19:17:13 +0000 (-0800) Subject: lib: update documentation of some *_free functions X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e7b1c4665fd02259d5bd43213fa9b8565d25a169;p=dpdk.git lib: update documentation of some *_free functions 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 --- diff --git a/lib/hash/rte_hash.h b/lib/hash/rte_hash.h index 6067aad954..7fa9702742 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 1e7a3c1527..1d3cdf7f22 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 ab6b4244c8..980e92e594 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);