linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] idr: Fix the kernel-doc for idr_is_empty()
@ 2025-07-30 11:34 Manivannan Sadhasivam
  2025-07-30 16:31 ` Sidhartha Kumar
  0 siblings, 1 reply; 2+ messages in thread
From: Manivannan Sadhasivam @ 2025-07-30 11:34 UTC (permalink / raw)
  To: willy; +Cc: linux-fsdevel, linux-mm, linux-kernel, Manivannan Sadhasivam

idr_is_empty() will return 'true' if IDR is empty and 'false' if any IDs
have been allocated from it. But the kernel-doc says the opposite. Hence,
fix it.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
---

Btw, I'm not sure if we really need the radix_tree_tagged() check in this
function. It looks redundant to me. But since I'm not too sure about it, I left
it as it is.

 include/linux/idr.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/linux/idr.h b/include/linux/idr.h
index 2267902d29a7..4955cf89e9c7 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -172,7 +172,9 @@ static inline void idr_init(struct idr *idr)
  * idr_is_empty() - Are there any IDs allocated?
  * @idr: IDR handle.
  *
- * Return: %true if any IDs have been allocated from this IDR.
+ * Return:
+ * * %true if this IDR is empty, or
+ * * %false if any IDs have been allocated from this IDR.
  */
 static inline bool idr_is_empty(const struct idr *idr)
 {
-- 
2.45.2



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] idr: Fix the kernel-doc for idr_is_empty()
  2025-07-30 11:34 [PATCH] idr: Fix the kernel-doc for idr_is_empty() Manivannan Sadhasivam
@ 2025-07-30 16:31 ` Sidhartha Kumar
  0 siblings, 0 replies; 2+ messages in thread
From: Sidhartha Kumar @ 2025-07-30 16:31 UTC (permalink / raw)
  To: Manivannan Sadhasivam, willy; +Cc: linux-fsdevel, linux-mm, linux-kernel

On 7/30/25 7:34 AM, Manivannan Sadhasivam wrote:
> idr_is_empty() will return 'true' if IDR is empty and 'false' if any IDs
> have been allocated from it. But the kernel-doc says the opposite. Hence,
> fix it.
> 
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>

Reviewed-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>

> ---
> 
> Btw, I'm not sure if we really need the radix_tree_tagged() check in this
> function. It looks redundant to me. But since I'm not too sure about it, I left
> it as it is.
> 
>   include/linux/idr.h | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/idr.h b/include/linux/idr.h
> index 2267902d29a7..4955cf89e9c7 100644
> --- a/include/linux/idr.h
> +++ b/include/linux/idr.h
> @@ -172,7 +172,9 @@ static inline void idr_init(struct idr *idr)
>    * idr_is_empty() - Are there any IDs allocated?
>    * @idr: IDR handle.
>    *
> - * Return: %true if any IDs have been allocated from this IDR.
> + * Return:
> + * * %true if this IDR is empty, or
> + * * %false if any IDs have been allocated from this IDR.
>    */
>   static inline bool idr_is_empty(const struct idr *idr)
>   {



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-30 16:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-30 11:34 [PATCH] idr: Fix the kernel-doc for idr_is_empty() Manivannan Sadhasivam
2025-07-30 16:31 ` Sidhartha Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox