kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] dlm: cleanup remove unused code
@ 2010-03-22 12:03 Dan Carpenter
  2010-03-22 13:50 ` David Teigland
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-03-22 12:03 UTC (permalink / raw)
  To: Christine Caulfield
  Cc: David Teigland, Steven Whitehouse, cluster-devel, linux-kernel,
	kernel-janitors

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 <error27@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 */

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] dlm: cleanup remove unused code
  2010-03-22 12:03 [patch] dlm: cleanup remove unused code Dan Carpenter
@ 2010-03-22 13:50 ` David Teigland
  0 siblings, 0 replies; 2+ messages in thread
From: David Teigland @ 2010-03-22 13:50 UTC (permalink / raw)
  To: Dan Carpenter, Christine Caulfield, Steven Whitehouse,
	cluster-devel, linux-kernel, kernel-janitors

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-22 13:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-22 12:03 [patch] dlm: cleanup remove unused code Dan Carpenter
2010-03-22 13:50 ` David Teigland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).