Skip to contentSkip to conversation

dlm: cleanup remove unused code

PATCH New David Teigland 1 participant 1 message May 19, 2010 Distributed lock manager (DLM)

lore
Share & tools
lore

David Teigland

author maintainer
#0 lore raw

PATCH 1/2 dlm: cleanup remove unused code

From: Dan Carpenter <[email protected]>

Smatch complains because "lkb" is never NULL. Looking at it, the original code actually adds the new element to the end of the list fine, so we can just get rid of the if condition. This code is four years old and no one has complained so it must work.

---
 fs/dlm/lock.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
fs/dlm/lock.c +1 -4
index 17903b4..031dbe3 100644
@@ -733,10 +733,7 @@ static void lkb_add_ordered(struct list_head *new, struct list_head *head,
 		if (lkb->lkb_rqmode < mode)
 			break;
 
-	if (!lkb)
-		list_add_tail(new, head);
-	else
-		__list_add(new, lkb->lkb_statequeue.prev, &lkb->lkb_statequeue);
+	__list_add(new, lkb->lkb_statequeue.prev, &lkb->lkb_statequeue);
 }
 
 /* add/remove lkb to rsb's grant/convert/wait queue */
Signature · 1 line
1.6.6