From patchwork Mon Jul 9 13:40:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alin-Gabriel Serdean X-Patchwork-Id: 941290 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41PRS25gHdz9s21 for ; Mon, 9 Jul 2018 23:45:54 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id BAFB0DDF; Mon, 9 Jul 2018 13:41:18 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id E03C8DC3 for ; Mon, 9 Jul 2018 13:41:14 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 5D954E2 for ; Mon, 9 Jul 2018 13:41:14 +0000 (UTC) X-Originating-IP: 82.79.245.216 Received: from localhost.localdomain (unknown [82.79.245.216]) (Authenticated sender: aserdean@ovn.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 86C9E1BF221; Mon, 9 Jul 2018 13:41:12 +0000 (UTC) From: Alin Gabriel Serdean To: dev@openvswitch.org Date: Mon, 9 Jul 2018 16:40:52 +0300 Message-Id: <20180709134056.7060-11-aserdean@ovn.org> X-Mailer: git-send-email 2.16.1.windows.1 In-Reply-To: <20180709134056.7060-1-aserdean@ovn.org> References: <20180709134056.7060-1-aserdean@ovn.org> X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Alin Gabriel Serdean Subject: [ovs-dev] [PATCH 10/14] datapath-windows: Cleanup PacketIO.c X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Assign variables directly instead of reassigning them after. Signed-off-by: Alin Gabriel Serdean --- datapath-windows/ovsext/PacketIO.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/datapath-windows/ovsext/PacketIO.c b/datapath-windows/ovsext/PacketIO.c index 38e3e5f36..ecbdd591d 100644 --- a/datapath-windows/ovsext/PacketIO.c +++ b/datapath-windows/ovsext/PacketIO.c @@ -185,12 +185,12 @@ OvsAppendNativeForwardedPacket(POVS_SWITCH_CONTEXT switchContext, ULONG flags, BOOLEAN isRecv) { - POVS_BUFFER_CONTEXT ctx = { 0 }; + POVS_BUFFER_CONTEXT ctx = OvsInitExternalNBLContext(switchContext, + curNbl, isRecv); NDIS_STRING filterReason; *nativeNbls = curNbl; - ctx = OvsInitExternalNBLContext(switchContext, curNbl, isRecv); if (ctx == NULL) { RtlInitUnicodeString(&filterReason, L"Cannot allocate native NBL context."); @@ -238,7 +238,7 @@ OvsStartNBLIngress(POVS_SWITCH_CONTEXT switchContext, OvsFlowKey key = { 0 }; UINT64 hash = 0; PNET_BUFFER curNb = NULL; - POVS_BUFFER_CONTEXT ctx = NULL; + POVS_BUFFER_CONTEXT ctx; nextNbl = curNbl->Next; curNbl->Next = NULL;