Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[patch] dlm: cleanup remove unused code

3 views
Skip to first unread message

Dan Carpenter

unread,
Mar 22, 2010, 8:10:02 AM3/22/10
to
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.

Signed-off-by: Dan Carpenter <err...@gmail.com>

diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 46ffd3e..f162de5 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -732,10 +732,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 */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

David Teigland

unread,
Mar 22, 2010, 10:00:03 AM3/22/10
to
On Mon, Mar 22, 2010 at 03:03:54PM +0300, Dan Carpenter wrote:
> 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.

Thanks, queued for the next pull.
Dave

0 new messages