]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c
Clean codes per ECC.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4ConfigDxe / Ip4ConfigDriver.c
index 081db47d49caf1146547d48641f0723ddbca5dd0..34dc96f0cae965c1c7b0812bce5108ac4852aeb1 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2006, Intel Corporation\r
+Copyright (c) 2006 - 2008, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -60,30 +60,22 @@ EfiIp4ConfigUnload (
   return NetLibDefaultUnload (ImageHandle);\r
 }\r
 \r
+/**\r
+  The entry point for IP4 config driver which install the driver\r
+  binding and component name protocol on its image.\r
+\r
+  @param  ImageHandle            The image handle of the driver.\r
+  @param  SystemTable            The system table.\r
 \r
+  @retval EFI_SUCCES             All the related protocols are installed on the driver.\r
+  @retval Others                 Failed to install protocols.\r
+\r
+**/\r
 EFI_STATUS\r
 Ip4ConfigDriverEntryPoint (\r
   IN EFI_HANDLE             ImageHandle,\r
   IN EFI_SYSTEM_TABLE       *SystemTable\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  The entry point for IP4 config driver which install the driver\r
-  binding and component name protocol on its image.\r
-\r
-Arguments:\r
-\r
-  ImageHandle - The Image handle of the driver\r
-  SystemTable - The system table\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - All the related protocols are installed on the driver\r
-  Others      - Failed to install the protocol\r
-\r
---*/\r
 {\r
   return EfiLibInstallDriverBindingComponentName2 (\r
            ImageHandle,\r
@@ -214,7 +206,7 @@ Ip4ConfigDriverBindingStart (
   //\r
   // Allocate an instance then initialize it\r
   //\r
-  Instance = NetAllocatePool (sizeof (IP4_CONFIG_INSTANCE));\r
+  Instance = AllocatePool (sizeof (IP4_CONFIG_INSTANCE));\r
 \r
   if (Instance == NULL) {\r
     Status = EFI_OUT_OF_RESOURCES;\r
@@ -332,7 +324,7 @@ Ip4ConfigDriverBindingStart (
     NewVariable = Ip4ConfigModifyVariable (Variable, &Instance->NicAddr, NULL);\r
 \r
   } else if (NicConfig->Source == IP4_CONFIG_SOURCE_DHCP) {\r
-    NetZeroMem (&NicConfig->Ip4Info, sizeof (EFI_IP4_IPCONFIG_DATA));\r
+    ZeroMem (&NicConfig->Ip4Info, sizeof (EFI_IP4_IPCONFIG_DATA));\r
     NewVariable = Ip4ConfigModifyVariable (Variable, &Instance->NicAddr, NicConfig);\r
 \r
   }\r
@@ -340,21 +332,21 @@ Ip4ConfigDriverBindingStart (
   Ip4ConfigWriteVariable (NewVariable);\r
 \r
   if (NewVariable != NULL) {\r
-    NetFreePool (NewVariable);\r
+    gBS->FreePool (NewVariable);\r
   }\r
 \r
 ON_EXIT:\r
-  NetFreePool (Variable);\r
+  gBS->FreePool (Variable);\r
 \r
   if (NicConfig != NULL) {\r
-    NetFreePool (NicConfig);\r
+    gBS->FreePool (NicConfig);\r
   }\r
 \r
   return EFI_SUCCESS;\r
 \r
 ON_ERROR:\r
   if (Instance != NULL) {\r
-    NetFreePool (Instance);\r
+    gBS->FreePool (Instance);\r
   }\r
 \r
   if (Mnp != NULL) {\r
@@ -511,7 +503,7 @@ Ip4ConfigDriverBindingStop (
 \r
   Ip4ConfigCleanConfig (Instance);\r
   mIp4ConfigNicList[Instance->NicIndex] = NULL;\r
-  NetFreePool (Instance);\r
+  gBS->FreePool (Instance);\r
 \r
   return EFI_SUCCESS;\r
 }\r