[v2,1/2] mempool: fix internal function documentation

Message ID 20231023093844.4150572-1-ferruh.yigit@amd.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v2,1/2] mempool: fix internal function documentation |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ferruh Yigit Oct. 23, 2023, 9:38 a.m. UTC
  static function `rte_mempool_do_generic_get()` returns zero on success,
not >=0 as its function comment documents.

Since this function called by public API, the comment causes confusion
on the public API return value.

Fixing the internal function documentation for return value.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org

Reported-by: Mahesh Adulla <mahesh.adulla@amd.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Huisong Li <lihuisong@huawei.com>
---
 .mailmap                  | 1 +
 lib/mempool/rte_mempool.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
  

Comments

Andrew Rybchenko Nov. 6, 2023, 12:24 p.m. UTC | #1
On 10/23/23 12:38, Ferruh Yigit wrote:
> static function `rte_mempool_do_generic_get()` returns zero on success,
> not >=0 as its function comment documents.
> 
> Since this function called by public API, the comment causes confusion
> on the public API return value.
> 
> Fixing the internal function documentation for return value.
> 
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
> 
> Reported-by: Mahesh Adulla <mahesh.adulla@amd.com>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
> Acked-by: Huisong Li <lihuisong@huawei.com>
> ---
>   .mailmap                  | 1 +
>   lib/mempool/rte_mempool.h | 2 +-
>   2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/.mailmap b/.mailmap
> index 3f5bab26a81f..bfe451980f1c 100644
> --- a/.mailmap
> +++ b/.mailmap
> @@ -836,6 +836,7 @@ Maciej Rabeda <maciej.rabeda@intel.com>
>   Maciej Szwed <maciej.szwed@intel.com>
>   Madhu Chittim <madhu.chittim@intel.com>
>   Madhuker Mythri <madhuker.mythri@oracle.com>
> +Mahesh Adulla <mahesh.adulla@amd.com>
>   Mahipal Challa <mchalla@marvell.com>
>   Mah Yock Gen <yock.gen.mah@intel.com>
>   Mairtin o Loingsigh <mairtin.oloingsigh@intel.com>
> diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h
> index f70bf36080fb..86598bc639e6 100644
> --- a/lib/mempool/rte_mempool.h
> +++ b/lib/mempool/rte_mempool.h
> @@ -1484,7 +1484,7 @@ rte_mempool_put(struct rte_mempool *mp, void *obj)
>    * @param cache
>    *   A pointer to a mempool cache structure. May be NULL if not needed.
>    * @return
> - *   - >=0: Success; number of objects supplied.
> + *   - 0: Success; number of objects supplied.

I think "number of objects supplied" does not make sense here any more.

>    *   - <0: Error; code of driver dequeue function.
>    */
>   static __rte_always_inline int
  
Thomas Monjalon Nov. 27, 2023, 2:41 p.m. UTC | #2
06/11/2023 13:24, Andrew Rybchenko:
> On 10/23/23 12:38, Ferruh Yigit wrote:
> > - *   - >=0: Success; number of objects supplied.
> > + *   - 0: Success; number of objects supplied.
> 
> I think "number of objects supplied" does not make sense here any more.

Yes, will remove on apply.
  

Patch

diff --git a/.mailmap b/.mailmap
index 3f5bab26a81f..bfe451980f1c 100644
--- a/.mailmap
+++ b/.mailmap
@@ -836,6 +836,7 @@  Maciej Rabeda <maciej.rabeda@intel.com>
 Maciej Szwed <maciej.szwed@intel.com>
 Madhu Chittim <madhu.chittim@intel.com>
 Madhuker Mythri <madhuker.mythri@oracle.com>
+Mahesh Adulla <mahesh.adulla@amd.com>
 Mahipal Challa <mchalla@marvell.com>
 Mah Yock Gen <yock.gen.mah@intel.com>
 Mairtin o Loingsigh <mairtin.oloingsigh@intel.com>
diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h
index f70bf36080fb..86598bc639e6 100644
--- a/lib/mempool/rte_mempool.h
+++ b/lib/mempool/rte_mempool.h
@@ -1484,7 +1484,7 @@  rte_mempool_put(struct rte_mempool *mp, void *obj)
  * @param cache
  *   A pointer to a mempool cache structure. May be NULL if not needed.
  * @return
- *   - >=0: Success; number of objects supplied.
+ *   - 0: Success; number of objects supplied.
  *   - <0: Error; code of driver dequeue function.
  */
 static __rte_always_inline int