list: fix order of arguments for hlist_add_after(_rcu)
PATCH 1/1 list: fix order of arguments for hlist_add_after(_rcu)
From: Ken Helias <[email protected]>
All other add functions for lists have the new item as first argument and the position where it is added as second argument. This was changed for no good reason in this function and makes using it unnecessary confusing.
The name was changed to hlist_add_behind() to cause unconverted code to generate a compile error instead of using the wrong parameter order.
---
The patch to fix the order of arguments was already submitted to davem via
http://article.gmane.org/gmane.linux.network/326598
compat.h | 6 ++++++ fragmentation.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-)
compat.h +6 -0
@@ -446,4 +446,10 @@ static int __batadv_interface_kill_vid(struct net_device *dev, __be16 proto,\#endif /* < KERNEL_VERSION(3, 16, 0) */ +#if LINUX_VERSION_CODE <KERNEL_VERSION (3 ,17 ,0 ) + +#define hlist_add_behind (n, prev) hlist_add_after(prev, n) + +#endif /* < KERNEL_VERSION(3, 17, 0) */ +#endif /* _NET_BATMAN_ADV_COMPAT_H_ */
fragmentation.c +1 -1
@@ -188,7 +188,7 @@ static bool batadv_frag_insert_packet(struct batadv_orig_node *orig_node,/* Reached the end of the list, so insert after 'frag_entry_last'. */ if (likely (frag_entry_last)) { -hlist_add_after (&frag_entry_last->list, &frag_entry_new->list); +hlist_add_behind (&frag_entry_new->list, &frag_entry_last->list); chain->size += skb->len - hdr_size; chain->timestamp = jiffies; ret = true;
Signature · 1 line
2.1.0.rc1
Marek Lindner
AppliedQuoted 20 lines · On Friday 15 August 2014 13:38:47 Sven Eckelmann wrote:
From: Ken Helias <[email protected]>
All other add functions for lists have the new item as first argument and the position where it is added as second argument. This was changed for no good reason in this function and makes using it unnecessary confusing.
The name was changed to
hlist_add_behind()to cause unconverted code to generate a compile error instead of using the wrong parameter order.[[email protected]: coding-style fixes]Signed-off-by Ken Helias <[email protected]>Cc "Paul E. McKenney" <[email protected]>Cc Hugh Dickins <[email protected]>Cc Christoph Hellwig <[email protected]>Signed-off-by Andrew Morton <[email protected]>Signed-off-by Linus Torvalds <[email protected]>[[email protected]: fix parameter order, add compat code]Signed-off-by Sven Eckelmann <[email protected]>
Quoted 7 lines
---
The patch to fix the order of arguments was already submitted to davem via
http://article.gmane.org/gmane.linux.network/326598compat.h | 6 ++++++ fragmentation.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-)
Applied in revision 8353fd1.
Thanks,
Marek