From: Allan Stephens Date: Wed, 21 May 2008 21:53:34 +0000 (-0700) Subject: tipc: Optimize null pointer check during neighbor discovery X-Git-Tag: v2.6.27-rc1~964^2~412 X-Git-Url: http://ftp.safe.ca/?a=commitdiff_plain;h=811102ca23dfdde5ee8b782b3a4bbff44c499cb2;hp=2ecb0924d7791372a70ef8f1174e37b329b955c3;p=safe%2Fjmp%2Flinux-2.6 tipc: Optimize null pointer check during neighbor discovery This patch optimizes TIPC neighbor discovery code to avoid testing for a null node pointer when the pointer is already known to be non-null. Signed-off-by: Allan Stephens Signed-off-by: David S. Miller --- diff --git a/net/tipc/discover.c b/net/tipc/discover.c index 5d643e5..faeaf06 100644 --- a/net/tipc/discover.c +++ b/net/tipc/discover.c @@ -200,9 +200,8 @@ void tipc_disc_recv_msg(struct sk_buff *buf) dbg(" in own cluster\n"); if (n_ptr == NULL) { n_ptr = tipc_node_create(orig); - } - if (n_ptr == NULL) { - return; + if (!n_ptr) + return; } spin_lock_bh(&n_ptr->lock); link = n_ptr->links[b_ptr->identity];