[RFC,1/4] rte_malloc: document that type is unused

Message ID 20240425182738.4771-2-stephen@networkplumber.org (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers
Series malloc type argument cleanup (part 1) |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger April 25, 2024, 6:23 p.m. UTC
  The string type is left over from first version of DPDK and
was never implemented.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/eal/include/rte_malloc.h | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)
  

Comments

Tyler Retzlaff April 25, 2024, 6:31 p.m. UTC | #1
On Thu, Apr 25, 2024 at 11:23:58AM -0700, Stephen Hemminger wrote:
> The string type is left over from first version of DPDK and
> was never implemented.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  lib/eal/include/rte_malloc.h | 21 +++++++--------------
>  1 file changed, 7 insertions(+), 14 deletions(-)
> 
> diff --git a/lib/eal/include/rte_malloc.h b/lib/eal/include/rte_malloc.h
> index 54a8ac211e..91c9214c57 100644
> --- a/lib/eal/include/rte_malloc.h
> +++ b/lib/eal/include/rte_malloc.h
> @@ -37,8 +37,7 @@ struct rte_malloc_socket_stats {
>   * NUMA socket as the core that calls this function.
>   *
>   * @param type
> - *   A string identifying the type of allocated objects (useful for debug
> - *   purposes, such as identifying the cause of a memory leak). Can be NULL.
> + *   Legacy argument, never unused should be NULL.

never unused seems unintended double negative.

should it be 'unused' or 'never used' 

>   * @param size
>   *   Size (in bytes) to be allocated.
>   * @param align
> @@ -64,8 +63,7 @@ rte_malloc(const char *type, size_t size, unsigned align)
>   * same NUMA socket as the core that calls this function.
>   *
>   * @param type
> - *   A string identifying the type of allocated objects (useful for debug
> - *   purposes, such as identifying the cause of a memory leak). Can be NULL.
> + *   Legacy argument, never unused should be NULL.
>   * @param size
>   *   Size (in bytes) to be allocated.
>   * @param align
> @@ -89,8 +87,7 @@ rte_zmalloc(const char *type, size_t size, unsigned align)
>   * same NUMA socket as the core that calls this function.
>   *
>   * @param type
> - *   A string identifying the type of allocated objects (useful for debug
> - *   purposes, such as identifying the cause of a memory leak). Can be NULL.
> + *   Legacy argument, never unused should be NULL.
>   * @param num
>   *   Number of elements to be allocated.
>   * @param size
> @@ -165,8 +162,7 @@ rte_realloc_socket(void *ptr, size_t size, unsigned int align, int socket)
>   * is not cleared.
>   *
>   * @param type
> - *   A string identifying the type of allocated objects (useful for debug
> - *   purposes, such as identifying the cause of a memory leak). Can be NULL.
> + *   Legacy argument, never unused should be NULL.
>   * @param size
>   *   Size (in bytes) to be allocated.
>   * @param align
> @@ -194,8 +190,7 @@ rte_malloc_socket(const char *type, size_t size, unsigned align, int socket)
>   * initialised with zeros.
>   *
>   * @param type
> - *   A string identifying the type of allocated objects (useful for debug
> - *   purposes, such as identifying the cause of a memory leak). Can be NULL.
> + *   Legacy argument, never unused should be NULL.
>   * @param size
>   *   Size (in bytes) to be allocated.
>   * @param align
> @@ -221,8 +216,7 @@ rte_zmalloc_socket(const char *type, size_t size, unsigned align, int socket)
>   * initialised with zeros.
>   *
>   * @param type
> - *   A string identifying the type of allocated objects (useful for debug
> - *   purposes, such as identifying the cause of a memory leak). Can be NULL.
> + *   Legacy argument, never unused should be NULL.
>   * @param num
>   *   Number of elements to be allocated.
>   * @param size
> @@ -502,8 +496,7 @@ rte_malloc_heap_socket_is_external(int socket_id);
>   * @param f
>   *   A pointer to a file for output
>   * @param type
> - *   A string identifying the type of objects to dump, or NULL
> - *   to dump all objects.
> + *   Legacy argument, never unused should be NULL.
>   */
>  void
>  rte_malloc_dump_stats(FILE *f, const char *type);
> -- 
> 2.43.0
  
Stephen Hemminger April 25, 2024, 6:42 p.m. UTC | #2
On Thu, 25 Apr 2024 11:31:31 -0700
Tyler Retzlaff <roretzla@linux.microsoft.com> wrote:

> On Thu, Apr 25, 2024 at 11:23:58AM -0700, Stephen Hemminger wrote:
> > The string type is left over from first version of DPDK and
> > was never implemented.
> > 
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> > ---
> >  lib/eal/include/rte_malloc.h | 21 +++++++--------------
> >  1 file changed, 7 insertions(+), 14 deletions(-)
> > 
> > diff --git a/lib/eal/include/rte_malloc.h b/lib/eal/include/rte_malloc.h
> > index 54a8ac211e..91c9214c57 100644
> > --- a/lib/eal/include/rte_malloc.h
> > +++ b/lib/eal/include/rte_malloc.h
> > @@ -37,8 +37,7 @@ struct rte_malloc_socket_stats {
> >   * NUMA socket as the core that calls this function.
> >   *
> >   * @param type
> > - *   A string identifying the type of allocated objects (useful for debug
> > - *   purposes, such as identifying the cause of a memory leak). Can be NULL.
> > + *   Legacy argument, never unused should be NULL.  
> 
> never unused seems unintended double negative.
> 
> should it be 'unused' or 'never used' 

thanks
  

Patch

diff --git a/lib/eal/include/rte_malloc.h b/lib/eal/include/rte_malloc.h
index 54a8ac211e..91c9214c57 100644
--- a/lib/eal/include/rte_malloc.h
+++ b/lib/eal/include/rte_malloc.h
@@ -37,8 +37,7 @@  struct rte_malloc_socket_stats {
  * NUMA socket as the core that calls this function.
  *
  * @param type
- *   A string identifying the type of allocated objects (useful for debug
- *   purposes, such as identifying the cause of a memory leak). Can be NULL.
+ *   Legacy argument, never unused should be NULL.
  * @param size
  *   Size (in bytes) to be allocated.
  * @param align
@@ -64,8 +63,7 @@  rte_malloc(const char *type, size_t size, unsigned align)
  * same NUMA socket as the core that calls this function.
  *
  * @param type
- *   A string identifying the type of allocated objects (useful for debug
- *   purposes, such as identifying the cause of a memory leak). Can be NULL.
+ *   Legacy argument, never unused should be NULL.
  * @param size
  *   Size (in bytes) to be allocated.
  * @param align
@@ -89,8 +87,7 @@  rte_zmalloc(const char *type, size_t size, unsigned align)
  * same NUMA socket as the core that calls this function.
  *
  * @param type
- *   A string identifying the type of allocated objects (useful for debug
- *   purposes, such as identifying the cause of a memory leak). Can be NULL.
+ *   Legacy argument, never unused should be NULL.
  * @param num
  *   Number of elements to be allocated.
  * @param size
@@ -165,8 +162,7 @@  rte_realloc_socket(void *ptr, size_t size, unsigned int align, int socket)
  * is not cleared.
  *
  * @param type
- *   A string identifying the type of allocated objects (useful for debug
- *   purposes, such as identifying the cause of a memory leak). Can be NULL.
+ *   Legacy argument, never unused should be NULL.
  * @param size
  *   Size (in bytes) to be allocated.
  * @param align
@@ -194,8 +190,7 @@  rte_malloc_socket(const char *type, size_t size, unsigned align, int socket)
  * initialised with zeros.
  *
  * @param type
- *   A string identifying the type of allocated objects (useful for debug
- *   purposes, such as identifying the cause of a memory leak). Can be NULL.
+ *   Legacy argument, never unused should be NULL.
  * @param size
  *   Size (in bytes) to be allocated.
  * @param align
@@ -221,8 +216,7 @@  rte_zmalloc_socket(const char *type, size_t size, unsigned align, int socket)
  * initialised with zeros.
  *
  * @param type
- *   A string identifying the type of allocated objects (useful for debug
- *   purposes, such as identifying the cause of a memory leak). Can be NULL.
+ *   Legacy argument, never unused should be NULL.
  * @param num
  *   Number of elements to be allocated.
  * @param size
@@ -502,8 +496,7 @@  rte_malloc_heap_socket_is_external(int socket_id);
  * @param f
  *   A pointer to a file for output
  * @param type
- *   A string identifying the type of objects to dump, or NULL
- *   to dump all objects.
+ *   Legacy argument, never unused should be NULL.
  */
 void
 rte_malloc_dump_stats(FILE *f, const char *type);