[PATCH 21/34] ptrlist: extract ptr_cur_insert from ptrlist.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 ptrlist.c | 21 +++++++++++++++++++++
 ptrlist.h | 22 +---------------------
 2 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/ptrlist.c b/ptrlist.c
index 031c53262..03a93db03 100644
--- a/ptrlist.c
+++ b/ptrlist.c
@@ -305,3 +305,24 @@ int ptr_cur_end(struct ptr_cur *cur, struct ptr_list *head)
 	cur->n = prev->nr;
 	return 1;
 }
+
+void ptr_cur_insert(struct ptr_cur *cur, void *new, void *ptr)
+{
+	void **this, **last;
+
+	if (cur->l->nr == LIST_NODE_NR) {
+		split_ptr_list_head(cur->l);
+		if (cur->n >= cur->l->nr) {
+			cur->n -= cur->l->nr;
+			cur->l = cur->l->next;
+		}
+	}
+	this = cur->l->list + cur->n;
+	last = cur->l->list + cur->l->nr - 1;
+	while (last >= this) {
+		last[1] = last[0];
+		last--;
+	}
+	*this = new;
+	cur->l->nr++;
+}
diff --git a/ptrlist.h b/ptrlist.h
index ab2b13a3c..26697c62f 100644
--- a/ptrlist.h
+++ b/ptrlist.h
@@ -55,6 +55,7 @@ int ptr_cur_beg(struct ptr_cur *cur, struct ptr_list *head);
 int ptr_cur_next(struct ptr_cur *cur);
 int ptr_cur_end(struct ptr_cur *cur, struct ptr_list *head);
 int ptr_cur_prev(struct ptr_cur *cur);
+void ptr_cur_insert(struct ptr_cur *cur, void *new, void *ptr);
 
 /*
  * Hey, who said that you can't do overloading in C?
@@ -213,27 +214,6 @@ do {										\
 
 extern void split_ptr_list_head(struct ptr_list *);
 
-static inline void ptr_cur_insert(struct ptr_cur *cur, void *new, void *ptr)
-{
-	void **this, **last;
-
-	if (cur->l->nr == LIST_NODE_NR) {
-		split_ptr_list_head(cur->l);
-		if (cur->n >= cur->l->nr) {
-			cur->n -= cur->l->nr;
-			cur->l = cur->l->next;
-		}
-	}
-	this = cur->l->list + cur->n;
-	last = cur->l->list + cur->l->nr - 1;
-	while (last >= this) {
-		last[1] = last[0];
-		last--;
-	}
-	*this = (new);
-	cur->l->nr++;
-}
-
 #define DO_INSERT_CURRENT(new, ptr, __cur) \
 	ptr_cur_insert(&__cur, new, ptr)
 
-- 
2.13.0

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux