From 0f333664833319991972d0c12b0978bbd837fde7 Mon Sep 17 00:00:00 2001 From: Wang Fan Date: Wed, 3 Jan 2018 17:53:29 +0800 Subject: NetworkPkg: Fix some coding style issues in UDP6 driver In UDP6Dxe, there are some coding style issues, this patch is to fix these issues. Cc: Ye Ting Cc: Jiaxin Wu Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan Reviewed-by: Jiaxin Wu --- NetworkPkg/Udp6Dxe/Udp6Driver.c | 20 ++++++++++---------- NetworkPkg/Udp6Dxe/Udp6Impl.c | 10 ++++++---- NetworkPkg/Udp6Dxe/Udp6Main.c | 2 +- 3 files changed, 17 insertions(+), 15 deletions(-) (limited to 'NetworkPkg/Udp6Dxe') diff --git a/NetworkPkg/Udp6Dxe/Udp6Driver.c b/NetworkPkg/Udp6Dxe/Udp6Driver.c index a4b1104d2b..6dde1fc07e 100644 --- a/NetworkPkg/Udp6Dxe/Udp6Driver.c +++ b/NetworkPkg/Udp6Dxe/Udp6Driver.c @@ -1,7 +1,7 @@ /** @file Driver Binding functions and Service Binding functions for the Network driver module. - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -164,7 +164,6 @@ Udp6DriverBindingStart ( ); if (EFI_ERROR (Status)) { Udp6CleanService (Udp6Service); - goto EXIT; } EXIT: @@ -182,8 +181,9 @@ EXIT: @param[in] Entry The entry to be removed. @param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList. - @retval EFI_SUCCESS The entry has been removed successfully. - @retval Others Fail to remove the entry. + @retval EFI_INVALID_PARAMETER Entry is NULL or Context is NULL. + @retval EFI_SUCCESS The entry has been removed successfully. + @retval Others Fail to remove the entry. **/ EFI_STATUS @@ -243,12 +243,12 @@ Udp6DriverBindingStop ( IN EFI_HANDLE *ChildHandleBuffer OPTIONAL ) { - EFI_STATUS Status; - EFI_HANDLE NicHandle; - EFI_SERVICE_BINDING_PROTOCOL *ServiceBinding; - UDP6_SERVICE_DATA *Udp6Service; - LIST_ENTRY *List; - UDP6_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT Context; + EFI_STATUS Status; + EFI_HANDLE NicHandle; + EFI_SERVICE_BINDING_PROTOCOL *ServiceBinding; + UDP6_SERVICE_DATA *Udp6Service; + LIST_ENTRY *List; + UDP6_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT Context; // // Find the NicHandle where UDP6 ServiceBinding Protocol is installed. diff --git a/NetworkPkg/Udp6Dxe/Udp6Impl.c b/NetworkPkg/Udp6Dxe/Udp6Impl.c index 25d4e6a80f..458470ce2c 100644 --- a/NetworkPkg/Udp6Dxe/Udp6Impl.c +++ b/NetworkPkg/Udp6Dxe/Udp6Impl.c @@ -158,7 +158,8 @@ Udp6RecycleRxDataWrap ( @param[in] RxData Pointer to the EFI_UDP6_RECEIVE_DATA of this datagram. - @return Pointer to the structure wrapping the RxData and the Packet. + @return Pointer to the structure wrapping the RxData and the Packet. NULL will + be returned if any error occurs. **/ UDP6_RXDATA_WRAP * @@ -1374,7 +1375,8 @@ Udp6RecycleRxDataWrap ( @param[in] RxData Pointer to the EFI_UDP6_RECEIVE_DATA of this datagram. - @return Pointer to the structure wrapping the RxData and the Packet. + @return Pointer to the structure wrapping the RxData and the Packet. NULL will + be returned if any error occurs. **/ UDP6_RXDATA_WRAP * @@ -1598,7 +1600,7 @@ Udp6Demultiplex ( EFI_UDP6_SESSION_DATA *Udp6Session; UINTN Enqueued; - if (Packet->TotalSize < sizeof (EFI_UDP_HEADER)) { + if (Packet->TotalSize < UDP6_HEADER_SIZE) { NetbufFree (Packet); return; } @@ -1850,7 +1852,7 @@ Udp6IcmpHandler ( LIST_ENTRY *Entry; UDP6_INSTANCE_DATA *Instance; - if (Packet->TotalSize < sizeof (EFI_UDP_HEADER)) { + if (Packet->TotalSize < UDP6_HEADER_SIZE) { NetbufFree (Packet); return; } diff --git a/NetworkPkg/Udp6Dxe/Udp6Main.c b/NetworkPkg/Udp6Dxe/Udp6Main.c index 8495bc332a..53145c38be 100644 --- a/NetworkPkg/Udp6Dxe/Udp6Main.c +++ b/NetworkPkg/Udp6Dxe/Udp6Main.c @@ -585,7 +585,7 @@ Udp6Transmit ( // // If the calculated checksum is 0, fill the Checksum field with all ones. // - Udp6Header->Checksum = 0XFFFF; + Udp6Header->Checksum = 0xffff; } } else { // -- cgit v1.2.3