]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg: Fix some coding style issues in UDP6 driver
authorWang Fan <fan.wang@intel.com>
Wed, 3 Jan 2018 09:53:29 +0000 (17:53 +0800)
committerFu Siyuan <siyuan.fu@intel.com>
Thu, 11 Jan 2018 09:08:32 +0000 (17:08 +0800)
In UDP6Dxe, there are some coding style issues, this patch
is to fix these issues.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wang Fan <fan.wang@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
NetworkPkg/Udp6Dxe/Udp6Driver.c
NetworkPkg/Udp6Dxe/Udp6Impl.c
NetworkPkg/Udp6Dxe/Udp6Main.c

index a4b1104d2b87dc2beab429a74549232fd279a16e..6dde1fc07e96cd56598a87e5a2e9eff46441c72b 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Driver Binding functions and Service Binding functions for the Network driver module.\r
 \r
-  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -164,7 +164,6 @@ Udp6DriverBindingStart (
                   );\r
   if (EFI_ERROR (Status)) {\r
     Udp6CleanService (Udp6Service);\r
-    goto EXIT;\r
   }\r
 \r
 EXIT:\r
@@ -182,8 +181,9 @@ EXIT:
   @param[in]    Entry           The entry to be removed.\r
   @param[in]    Context         Pointer to the callback context corresponds to the Context in NetDestroyLinkList.\r
 \r
-  @retval EFI_SUCCESS           The entry has been removed successfully.\r
-  @retval Others                Fail to remove the entry.\r
+  @retval EFI_INVALID_PARAMETER  Entry is NULL or Context is NULL.\r
+  @retval EFI_SUCCESS            The entry has been removed successfully.\r
+  @retval Others                 Fail to remove the entry.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -243,12 +243,12 @@ Udp6DriverBindingStop (
   IN  EFI_HANDLE                   *ChildHandleBuffer OPTIONAL\r
   )\r
 {\r
-  EFI_STATUS                    Status;\r
-  EFI_HANDLE                    NicHandle;\r
-  EFI_SERVICE_BINDING_PROTOCOL  *ServiceBinding;\r
-  UDP6_SERVICE_DATA             *Udp6Service;\r
-  LIST_ENTRY                    *List;\r
-  UDP6_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT Context;\r
+  EFI_STATUS                                Status;\r
+  EFI_HANDLE                                NicHandle;\r
+  EFI_SERVICE_BINDING_PROTOCOL              *ServiceBinding;\r
+  UDP6_SERVICE_DATA                         *Udp6Service;\r
+  LIST_ENTRY                                *List;\r
+  UDP6_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT  Context;\r
 \r
   //\r
   // Find the NicHandle where UDP6 ServiceBinding Protocol is installed.\r
index 25d4e6a80f4ed14c42bc4f45fa7e3d7c925ba96d..458470ce2c56d80d9432f7a0151e8e465f0c7191 100644 (file)
@@ -158,7 +158,8 @@ Udp6RecycleRxDataWrap (
   @param[in]  RxData             Pointer to the EFI_UDP6_RECEIVE_DATA of this\r
                                  datagram.\r
 \r
-  @return Pointer to the structure wrapping the RxData and the Packet.\r
+  @return Pointer to the structure wrapping the RxData and the Packet. NULL will\r
+          be returned if any error occurs.\r
 \r
 **/\r
 UDP6_RXDATA_WRAP *\r
@@ -1374,7 +1375,8 @@ Udp6RecycleRxDataWrap (
   @param[in]  RxData             Pointer to the EFI_UDP6_RECEIVE_DATA of this\r
                                  datagram.\r
 \r
-  @return Pointer to the structure wrapping the RxData and the Packet.\r
+  @return Pointer to the structure wrapping the RxData and the Packet. NULL will\r
+          be returned if any error occurs.\r
 \r
 **/\r
 UDP6_RXDATA_WRAP *\r
@@ -1598,7 +1600,7 @@ Udp6Demultiplex (
   EFI_UDP6_SESSION_DATA  *Udp6Session;\r
   UINTN                  Enqueued;\r
 \r
-  if (Packet->TotalSize < sizeof (EFI_UDP_HEADER)) {\r
+  if (Packet->TotalSize < UDP6_HEADER_SIZE) {\r
     NetbufFree (Packet);\r
     return;\r
   }\r
@@ -1850,7 +1852,7 @@ Udp6IcmpHandler (
   LIST_ENTRY             *Entry;\r
   UDP6_INSTANCE_DATA     *Instance;\r
 \r
-  if (Packet->TotalSize < sizeof (EFI_UDP_HEADER)) {\r
+  if (Packet->TotalSize < UDP6_HEADER_SIZE) {\r
     NetbufFree (Packet);\r
     return;\r
   }\r
index 8495bc332a908507380cc07ab4ce14051745b9c7..53145c38bebb433d84a2a46c0fb0cd2399f8759e 100644 (file)
@@ -585,7 +585,7 @@ Udp6Transmit (
         //\r
         // If the calculated checksum is 0, fill the Checksum field with all ones.\r
         //\r
-        Udp6Header->Checksum = 0XFFFF;\r
+        Udp6Header->Checksum = 0xffff;\r
       }\r
     } else {\r
       //\r