]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/SnpDxe/ComponentName.c
BaseTools:Change the path of the file that Binary Cache
[mirror_edk2.git] / MdeModulePkg / Universal / Network / SnpDxe / ComponentName.c
index 0b12359f14b60c99329579edbcffb3a33bc542a6..2139e2a47f534c83f16269e0cfd6f5db1d5746ce 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
     UEFI Component Name(2) protocol implementation for SnpDxe driver.\r
 \r
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials are licensed \r
-and made available under the terms and conditions of the BSD License which \r
-accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -238,10 +232,10 @@ SimpleNetworkComponentNameGetDriverName (
 \r
   @param  Snp[in]                   A pointer to the EFI_SIMPLE_NETWORK_PROTOCOL.\r
 \r
-  \r
+\r
   @retval EFI_SUCCESS               Update the ControllerNameTable of this instance successfully.\r
   @retval EFI_INVALID_PARAMETER     The input parameter is invalid.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 UpdateName (\r
@@ -271,6 +265,7 @@ UpdateName (
                 Snp->Mode->CurrentAddress.Addr[Index]\r
                 );\r
   }\r
+  ASSERT (OffSet > 0);\r
   //\r
   // Remove the last '-'\r
   //\r
@@ -284,7 +279,7 @@ UpdateName (
     FreeUnicodeStringTable (gSimpleNetworkControllerNameTable);\r
     gSimpleNetworkControllerNameTable = NULL;\r
   }\r
-  \r
+\r
   Status = AddUnicodeString2 (\r
              "eng",\r
              gSimpleNetworkComponentName.SupportedLanguages,\r
@@ -295,7 +290,7 @@ UpdateName (
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
-  \r
+\r
   return AddUnicodeString2 (\r
            "en",\r
            gSimpleNetworkComponentName2.SupportedLanguages,\r
@@ -316,8 +311,8 @@ UpdateName (
   and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
   managing the controller specified by ControllerHandle and ChildHandle,\r
   then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
-  support the language specified by Language, then EFI_UNSUPPORTED is returned. \r
-  Currently not implemented. \r
+  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
+  Currently not implemented.\r
 \r
   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
                                 EFI_COMPONENT_NAME_PROTOCOL instance.\r
@@ -386,7 +381,7 @@ SimpleNetworkComponentNameGetControllerName (
 {\r
   EFI_STATUS                    Status;\r
   EFI_SIMPLE_NETWORK_PROTOCOL   *Snp;\r
-  \r
+\r
   if (ChildHandle != NULL) {\r
     return EFI_UNSUPPORTED;\r
   }\r
@@ -403,9 +398,9 @@ SimpleNetworkComponentNameGetControllerName (
     return Status;\r
   }\r
 \r
-  // \r
+  //\r
   // Retrieve an instance of a produced protocol from ControllerHandle\r
-  // \r
+  //\r
   Status = gBS->OpenProtocol (\r
                   ControllerHandle,\r
                   &gEfiSimpleNetworkProtocolGuid,\r