[ovs-dev] [PATCH 02/14] datapath-windows: Cleanup BufferMgmt.c

Shashank Ram rams at vmware.com
Wed Jul 11 22:51:17 UTC 2018



On 07/09/2018 06:40 AM, Alin Gabriel Serdean wrote:
> Assign variables directly instead of reassigning them after.
>
> Signed-off-by: Alin Gabriel Serdean <aserdean at ovn.org>
> ---
>   datapath-windows/ovsext/BufferMgmt.c | 14 ++++----------
>   1 file changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/datapath-windows/ovsext/BufferMgmt.c b/datapath-windows/ovsext/BufferMgmt.c
> index 448cd7652..0f1c705d2 100644
> --- a/datapath-windows/ovsext/BufferMgmt.c
> +++ b/datapath-windows/ovsext/BufferMgmt.c
> @@ -1163,12 +1163,9 @@ FixFragmentHeader(PNET_BUFFER nb, UINT16 fragmentSize,
>                     BOOLEAN lastPacket, UINT16 offset)
>   {
>       EthHdr *dstEth = NULL;
> -    PMDL mdl = NULL;
> -    PUINT8 bufferStart = NULL;
> +    PMDL mdl = NET_BUFFER_FIRST_MDL(nb);
> +    PUINT8 bufferStart = (PUINT8)OvsGetMdlWithLowPriority(mdl);
>   
> -    mdl = NET_BUFFER_FIRST_MDL(nb);
> -
> -    bufferStart = (PUINT8)OvsGetMdlWithLowPriority(mdl);
>       if (!bufferStart) {
>           return NDIS_STATUS_RESOURCES;
>       }
> @@ -1221,12 +1218,9 @@ FixSegmentHeader(PNET_BUFFER nb, UINT16 segmentSize, UINT32 seqNumber,
>   {
>       EthHdr *dstEth = NULL;
>       TCPHdr *dstTCP = NULL;
> -    PMDL mdl = NULL;
> -    PUINT8 bufferStart = NULL;
> -
> -    mdl = NET_BUFFER_FIRST_MDL(nb);
> +    PMDL mdl = NET_BUFFER_FIRST_MDL(nb);
> +    PUINT8 bufferStart = (PUINT8)OvsGetMdlWithLowPriority(mdl);
>   
> -    bufferStart = (PUINT8)OvsGetMdlWithLowPriority(mdl);
>       if (!bufferStart) {
>           return NDIS_STATUS_RESOURCES;
>       }

Acked-by: Shashank Ram <rams at vmware.com>


More information about the dev mailing list