list: make hlist_add_after() argument names match hlist_add_after_rcu()
authorKen Helias <kenhelias@firemail.de>
Wed, 6 Aug 2014 23:09:14 +0000 (16:09 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 7 Aug 2014 01:01:24 +0000 (18:01 -0700)
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 <kenhelias@firemail.de>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/list.h

index ef959417106222d475fbc01c419cf42db05dcca6..624ec7f48293b3e37968d0486b58b2c31e315383 100644 (file)
@@ -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 */