linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] radix-tree: fix some errors in comment
@ 2020-03-13 18:49 Qiujun Huang
  2020-03-13 18:49 ` [PATCH 1/2] radix-tree: fix kernel-doc for radix_tree_find_next_bit Qiujun Huang
  2020-03-13 18:49 ` [PATCH 2/2] radix-tree: fix a typo Qiujun Huang
  0 siblings, 2 replies; 7+ messages in thread
From: Qiujun Huang @ 2020-03-13 18:49 UTC (permalink / raw)
  To: willy; +Cc: gregkh, linux-kernel, Qiujun Huang

Update the comment.

Qiujun Huang (2):
  radix-tree: fix kernel-doc for radix_tree_find_next_bit
  radix-tree: fix a typo

 lib/radix-tree.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

-- 
2.17.1


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

* [PATCH 1/2] radix-tree: fix kernel-doc for radix_tree_find_next_bit
  2020-03-13 18:49 [PATCH 0/2] radix-tree: fix some errors in comment Qiujun Huang
@ 2020-03-13 18:49 ` Qiujun Huang
  2020-03-13 19:14   ` Matthew Wilcox
  2020-03-13 18:49 ` [PATCH 2/2] radix-tree: fix a typo Qiujun Huang
  1 sibling, 1 reply; 7+ messages in thread
From: Qiujun Huang @ 2020-03-13 18:49 UTC (permalink / raw)
  To: willy; +Cc: gregkh, linux-kernel, Qiujun Huang

The function changed at some point, but the kernel-doc was
not updated.

Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
---
 lib/radix-tree.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/radix-tree.c b/lib/radix-tree.c
index c8fa1d274530..379137875e25 100644
--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -178,12 +178,11 @@ static inline void all_tag_set(struct radix_tree_node *node, unsigned int tag)
  * radix_tree_find_next_bit - find the next set bit in a memory region
  *
  * @addr: The address to base the search on
- * @size: The bitmap size in bits
+ * @tag: The tag index (< RADIX_TREE_MAX_TAGS)
  * @offset: The bitnumber to start searching at
  *
  * Unrollable variant of find_next_bit() for constant size arrays.
- * Tail bits starting from size to roundup(size, BITS_PER_LONG) must be zero.
- * Returns next bit offset, or size if nothing found.
+ * Returns next bit offset, or RADIX_TREE_MAP_SIZE if nothing found.
  */
 static __always_inline unsigned long
 radix_tree_find_next_bit(struct radix_tree_node *node, unsigned int tag,
-- 
2.17.1


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

* [PATCH 2/2] radix-tree: fix a typo
  2020-03-13 18:49 [PATCH 0/2] radix-tree: fix some errors in comment Qiujun Huang
  2020-03-13 18:49 ` [PATCH 1/2] radix-tree: fix kernel-doc for radix_tree_find_next_bit Qiujun Huang
@ 2020-03-13 18:49 ` Qiujun Huang
  2020-03-13 19:12   ` Matthew Wilcox
  1 sibling, 1 reply; 7+ messages in thread
From: Qiujun Huang @ 2020-03-13 18:49 UTC (permalink / raw)
  To: willy; +Cc: gregkh, linux-kernel, Qiujun Huang

"iff" -> "if"

Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
---
 lib/radix-tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/radix-tree.c b/lib/radix-tree.c
index 379137875e25..0534823adf07 100644
--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -794,7 +794,7 @@ void *__radix_tree_lookup(const struct radix_tree_root *root,
  *	Returns:  the slot corresponding to the position @index in the
  *	radix tree @root. This is useful for update-if-exists operations.
  *
- *	This function can be called under rcu_read_lock iff the slot is not
+ *	This function can be called under rcu_read_lock if the slot is not
  *	modified by radix_tree_replace_slot, otherwise it must be called
  *	exclusive from other writers. Any dereference of the slot must be done
  *	using radix_tree_deref_slot.
-- 
2.17.1


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

* Re: [PATCH 2/2] radix-tree: fix a typo
  2020-03-13 18:49 ` [PATCH 2/2] radix-tree: fix a typo Qiujun Huang
@ 2020-03-13 19:12   ` Matthew Wilcox
  2020-03-13 23:16     ` Qiujun Huang
  0 siblings, 1 reply; 7+ messages in thread
From: Matthew Wilcox @ 2020-03-13 19:12 UTC (permalink / raw)
  To: Qiujun Huang; +Cc: gregkh, linux-kernel

On Sat, Mar 14, 2020 at 02:49:09AM +0800, Qiujun Huang wrote:
> "iff" -> "if"

> - *	This function can be called under rcu_read_lock iff the slot is not
> + *	This function can be called under rcu_read_lock if the slot is not

That's not a typo, it's a mathematician's shorthand for "if and only if".
I'm not excited about fixing problems in the radix tree code; better to
focus efforts on migrating users to the xarray.

http://git.infradead.org/users/willy/linux-dax.git/shortlog/refs/heads/xarray-conv
is an out of date effort to do every user.

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

* Re: [PATCH 1/2] radix-tree: fix kernel-doc for radix_tree_find_next_bit
  2020-03-13 18:49 ` [PATCH 1/2] radix-tree: fix kernel-doc for radix_tree_find_next_bit Qiujun Huang
@ 2020-03-13 19:14   ` Matthew Wilcox
  2020-03-13 23:18     ` Qiujun Huang
  0 siblings, 1 reply; 7+ messages in thread
From: Matthew Wilcox @ 2020-03-13 19:14 UTC (permalink / raw)
  To: Qiujun Huang; +Cc: gregkh, linux-kernel

On Sat, Mar 14, 2020 at 02:49:08AM +0800, Qiujun Huang wrote:
>   * radix_tree_find_next_bit - find the next set bit in a memory region
>   *
>   * @addr: The address to base the search on
> - * @size: The bitmap size in bits
> + * @tag: The tag index (< RADIX_TREE_MAX_TAGS)
>   * @offset: The bitnumber to start searching at
>   *
>   * Unrollable variant of find_next_bit() for constant size arrays.
> - * Tail bits starting from size to roundup(size, BITS_PER_LONG) must be zero.
> - * Returns next bit offset, or size if nothing found.
> + * Returns next bit offset, or RADIX_TREE_MAP_SIZE if nothing found.
>   */
>  static __always_inline unsigned long
>  radix_tree_find_next_bit(struct radix_tree_node *node, unsigned int tag,

Ugh, this is a static function with kernel-doc.  What a waste of time ;-(

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

* Re: [PATCH 2/2] radix-tree: fix a typo
  2020-03-13 19:12   ` Matthew Wilcox
@ 2020-03-13 23:16     ` Qiujun Huang
  0 siblings, 0 replies; 7+ messages in thread
From: Qiujun Huang @ 2020-03-13 23:16 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: gregkh, LKML

On Sat, Mar 14, 2020 at 3:12 AM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Sat, Mar 14, 2020 at 02:49:09AM +0800, Qiujun Huang wrote:
> > "iff" -> "if"
>
> > - *   This function can be called under rcu_read_lock iff the slot is not
> > + *   This function can be called under rcu_read_lock if the slot is not
>
> That's not a typo, it's a mathematician's shorthand for "if and only if".
> I'm not excited about fixing problems in the radix tree code; better to
> focus efforts on migrating users to the xarray.

I get that, thanks.

>
> http://git.infradead.org/users/willy/linux-dax.git/shortlog/refs/heads/xarray-conv
> is an out of date effort to do every user.

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

* Re: [PATCH 1/2] radix-tree: fix kernel-doc for radix_tree_find_next_bit
  2020-03-13 19:14   ` Matthew Wilcox
@ 2020-03-13 23:18     ` Qiujun Huang
  0 siblings, 0 replies; 7+ messages in thread
From: Qiujun Huang @ 2020-03-13 23:18 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: gregkh, LKML

I thought it's better to update the function description as it could
be more readable from source code.

On Sat, Mar 14, 2020 at 3:14 AM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Sat, Mar 14, 2020 at 02:49:08AM +0800, Qiujun Huang wrote:
> >   * radix_tree_find_next_bit - find the next set bit in a memory region
> >   *
> >   * @addr: The address to base the search on
> > - * @size: The bitmap size in bits
> > + * @tag: The tag index (< RADIX_TREE_MAX_TAGS)
> >   * @offset: The bitnumber to start searching at
> >   *
> >   * Unrollable variant of find_next_bit() for constant size arrays.
> > - * Tail bits starting from size to roundup(size, BITS_PER_LONG) must be zero.
> > - * Returns next bit offset, or size if nothing found.
> > + * Returns next bit offset, or RADIX_TREE_MAP_SIZE if nothing found.
> >   */
> >  static __always_inline unsigned long
> >  radix_tree_find_next_bit(struct radix_tree_node *node, unsigned int tag,
>
> Ugh, this is a static function with kernel-doc.  What a waste of time ;-(

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

end of thread, other threads:[~2020-03-13 23:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-13 18:49 [PATCH 0/2] radix-tree: fix some errors in comment Qiujun Huang
2020-03-13 18:49 ` [PATCH 1/2] radix-tree: fix kernel-doc for radix_tree_find_next_bit Qiujun Huang
2020-03-13 19:14   ` Matthew Wilcox
2020-03-13 23:18     ` Qiujun Huang
2020-03-13 18:49 ` [PATCH 2/2] radix-tree: fix a typo Qiujun Huang
2020-03-13 19:12   ` Matthew Wilcox
2020-03-13 23:16     ` Qiujun Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).