Skip to content

Commit

Permalink
list: make hlist_add_after() argument names match hlist_add_after_rcu()
Browse files Browse the repository at this point in the history
The argument names for hlist_add_after() are poorly chosen because they
look the same as the ones for hlist_add_before() but have to be used
differently.

hlist_add_after_rcu() has made a better choice.

Signed-off-by: Ken Helias <[email protected]>
Cc: "Paul E. McKenney" <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Jeff Kirsher <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Ken Helias authored and torvalds committed Aug 7, 2014
1 parent d25d9fe commit bc18dd3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions include/linux/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -654,15 +654,15 @@ static inline void hlist_add_before(struct hlist_node *n,
*(n->pprev) = n;
}

static inline void hlist_add_after(struct hlist_node *n,
struct hlist_node *next)
static inline void hlist_add_after(struct hlist_node *prev,
struct hlist_node *n)
{
next->next = n->next;
n->next = next;
next->pprev = &n->next;
n->next = prev->next;
prev->next = n;
n->pprev = &prev->next;

if(next->next)
next->next->pprev = &next->next;
if (n->next)
n->next->pprev = &n->next;
}

/* after that we'll appear to be on some hlist and hlist_del will work */
Expand Down

0 comments on commit bc18dd3

Please sign in to comment.