[ovs-dev] [PATCH 2/2] datapath: Avoid duplicate test in tnl_free_linked_skbs().

Ben Pfaff blp at nicira.com
Tue Mar 1 23:34:50 UTC 2011


I don't see the value in testing 'skb' for nonnull twice.  This is only
called on error paths, so it seems really doubtful to me that there is any
value in the "unlikely", either.  (It could be put into the "while"
expression if it is valuable.)

Signed-off-by: Ben Pfaff <blp at nicira.com>
---
 datapath/tunnel.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/datapath/tunnel.c b/datapath/tunnel.c
index 07bb00b..7e0c8ee 100644
--- a/datapath/tunnel.c
+++ b/datapath/tunnel.c
@@ -1571,9 +1571,6 @@ const unsigned char *tnl_get_addr(const struct vport *vport)
 
 void tnl_free_linked_skbs(struct sk_buff *skb)
 {
-	if (unlikely(!skb))
-		return;
-
 	while (skb) {
 		struct sk_buff *next = skb->next;
 		kfree_skb(skb);
-- 
1.7.1





More information about the dev mailing list