Skip to contentSkip to conversation

mm: Don't reinvent the wheel but use existing llist API

PATCH RESEND Applied Byungchul Park 1 participant 1 message Aug 7, 2017

Subsystems (2)

v1 of 4 Applied 1/1 Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 mm: Don't reinvent the wheel but use existing llist API

Although llist provides proper APIs, they are not used. Make them used.

---
 mm/vmalloc.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
mm/vmalloc.c +4 -6
index 3ca82d4..8c0eb45 100644
@@ -49,12 +49,10 @@ struct vfree_deferred {
 static void free_work(struct work_struct *w)
 {
 	struct vfree_deferred *p = container_of(w, struct vfree_deferred, wq);
-	struct llist_node *llnode = llist_del_all(&p->list);
-	while (llnode) {
-		void *p = llnode;
-		llnode = llist_next(llnode);
-		__vunmap(p, 1);
-	}
+	struct llist_node *t, *llnode;
+
+	llist_for_each_safe(llnode, t, llist_del_all(&p->list))
+		__vunmap((void *)llnode, 1);
 }
 
 /*** Page table manipulation functions ***/
Signature · 7 lines
1.9.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>