From patchwork Fri Aug 15 11:38:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 4170 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=79.140.41.39; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver=b.a.t.m.a.n@lists.open-mesh.org Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id B291A600A98 for ; Fri, 15 Aug 2014 13:39:11 +0200 (CEST) Received: from sven-desktop.home.narfation.org (drsd-4db3dea9.pool.mediaWays.net [77.179.222.169]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 2AEF8110108; Fri, 15 Aug 2014 13:39:11 +0200 (CEST) From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Fri, 15 Aug 2014 13:38:47 +0200 Message-Id: <1408102727-12671-1-git-send-email-sven@narfation.org> X-Mailer: git-send-email 2.1.0.rc1 Cc: sven@narfation.org Subject: [B.A.T.M.A.N.] [PATCH] list: fix order of arguments for hlist_add_after(_rcu) X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Aug 2014 11:39:11 -0000 From: Ken Helias 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. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Ken Helias Cc: "Paul E. McKenney" Acked-by: Jeff Kirsher [intel driver bits] Cc: Hugh Dickins Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds [sven@narfation.org: fix parameter order, add compat code] Signed-off-by: Sven Eckelmann --- 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(-) diff --git a/compat.h b/compat.h index ed5b815..eb837ae 100644 --- a/compat.h +++ b/compat.h @@ -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_ */ diff --git a/fragmentation.c b/fragmentation.c index 022d18a..fc1835c 100644 --- a/fragmentation.c +++ b/fragmentation.c @@ -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;