[ovs-dev,12/14] datapath-windows: Cleanup Tunnel.c

Message ID 20180709134056.7060-13-aserdean@ovn.org
State Changes Requested
Headers show
Series
  • Cleanup datapath-windows
Related show

Commit Message

Alin Gabriel Serdean July 9, 2018, 1:40 p.m.
Assign variables directly instead of reassigning them after.

Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
---
 datapath-windows/ovsext/Tunnel.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Patch

diff --git a/datapath-windows/ovsext/Tunnel.c b/datapath-windows/ovsext/Tunnel.c
index ad2c254f5..899fce885 100644
--- a/datapath-windows/ovsext/Tunnel.c
+++ b/datapath-windows/ovsext/Tunnel.c
@@ -65,7 +65,7 @@  OvsTunnelAnalyzePacket(OVS_TUNNEL_PENDED_PACKET *packet)
     NTSTATUS status = STATUS_SUCCESS;
     UINT32 packetLength = 0;
     ULONG bytesCopied = 0;
-    NET_BUFFER_LIST *copiedNBL = NULL;
+    NET_BUFFER_LIST *copiedNBL;
     NET_BUFFER *netBuffer;
     NDIS_STATUS ndisStatus;
 
@@ -248,12 +248,12 @@  OvsInjectPacketThroughActions(PNET_BUFFER_LIST pNbl,
                           sendCompleteFlags);
 
     {
-        POVS_VPORT_ENTRY vport = NULL;
+        POVS_VPORT_ENTRY vport;
         UINT32 portNo = 0;
         OVS_PACKET_HDR_INFO layers = { 0 };
         OvsFlowKey key = { 0 };
         UINT64 hash = 0;
-        PNET_BUFFER curNb = NULL;
+        PNET_BUFFER curNb = NET_BUFFER_LIST_FIRST_NB(pNbl);
         OvsFlow *flow = NULL;
 
         fwdDetail = NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(pNbl);
@@ -265,7 +265,6 @@  OvsInjectPacketThroughActions(PNET_BUFFER_LIST pNbl,
          * We still need to check if the Ethernet header of the innet packet is in a single MD
          */
 
-        curNb = NET_BUFFER_LIST_FIRST_NB(pNbl);
         ASSERT(curNb->Next == NULL);
 
         NdisAcquireRWLockRead(gOvsSwitchContext->dispatchLock, &lockState, dispatch);