24/01/2022 18:45, Stephen Hemminger: > 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 <step...@networkplumber.org> > --- > /** > * De-allocate all memory used by hash table. > + * > + * If the pointer is NULL, the function does nothing.
Would be better to move in the context of the parameter. > + * > * @param h > * Hash table to free Here: If NULL, the function does nothing. Same for comment for all files of this patch. > @@ -108,6 +108,8 @@ struct rte_kvargs *rte_kvargs_parse_delim(const char > *args, > * Free a rte_kvargs structure previously allocated with > * rte_kvargs_parse(). > * > + * If the pointer is NULL, the function does nothing. > + * > * @param kvlist > * The rte_kvargs structure. No error if NULL. Would need to reword "No error" to "Does nothing". > @@ -1372,6 +1372,8 @@ rte_pktmbuf_free_seg(struct rte_mbuf *m) > * Free an mbuf, and all its segments in case of chained buffers. Each > * segment is added back into its original mempool. > * > + * If the pointer is NULL, the function does nothing. > + * > * @param m > * The packet mbuf to be freed. If NULL, the function does nothing. Here the comment exists already in the right place.