[ovs-dev] [PATCH] datapath: Don't set tunnel_id in a function.

Jesse Gross jesse at nicira.com
Thu Jul 15 20:08:03 UTC 2010


We don't need a function to set a variable.  In practice it will
almost certainly get inlined but this makes it easier to read.
---
 datapath/actions.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/datapath/actions.c b/datapath/actions.c
index 131548c..a13a3e3 100644
--- a/datapath/actions.c
+++ b/datapath/actions.c
@@ -47,12 +47,6 @@ make_writable(struct sk_buff *skb, unsigned min_headroom, gfp_t gfp)
 	return NULL;
 }
 
-static void set_tunnel(struct sk_buff *skb, struct odp_flow_key *key,
-		       __be32 tun_id)
-{
-	OVS_CB(skb)->tun_id = key->tun_id = tun_id;
-}
-
 static struct sk_buff *
 vlan_pull_tag(struct sk_buff *skb)
 {
@@ -475,7 +469,7 @@ int execute_actions(struct datapath *dp, struct sk_buff *skb,
 			break;
 
 		case ODPAT_SET_TUNNEL:
-			set_tunnel(skb, key, a->tunnel.tun_id);
+			OVS_CB(skb)->tun_id = key->tun_id = a->tunnel.tun_id;
 			break;
 
 		case ODPAT_SET_VLAN_VID:
-- 
1.7.0.4





More information about the dev mailing list