]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIo.c
UefiCpuPkg: Remove double \r
[mirror_edk2.git] / Nt32Pkg / WinNtSerialIoDxe / WinNtSerialIo.c
index bd7424738778688abc7b51154a3737d866a763ae..96167d572370ef88b60bd72e908bea6538e70e67 100644 (file)
@@ -1,13 +1,7 @@
 /**@file\r
 \r
 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-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
-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
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 Module Name:\r
 \r
@@ -175,6 +169,7 @@ Returns:
   EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer;\r
   UINTN                               EntryCount;\r
   UINTN                               Index;\r
+  BOOLEAN                             RemainingDevicePathContainsFlowControl; \r
 \r
   //\r
   // Check RemainingDevicePath validation\r
@@ -261,6 +256,11 @@ Returns:
       return Status;\r
     }\r
 \r
+    //\r
+    // See if RemainingDevicePath has a Flow Control device path node\r
+    //\r
+    RemainingDevicePathContainsFlowControl = ContainsFlowControl (RemainingDevicePath);\r
+    \r
     for (Index = 0; Index < EntryCount; Index++) {\r
       if ((OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {\r
         Status = gBS->OpenProtocol (\r
@@ -271,9 +271,10 @@ Returns:
                         Handle,\r
                         EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
                         );\r
-        if (!EFI_ERROR (Status) &&\r
-            (ContainsFlowControl (RemainingDevicePath) ^ ContainsFlowControl (DevicePath))) {\r
-          Status = EFI_UNSUPPORTED;\r
+        if (!EFI_ERROR (Status)) {\r
+          if (RemainingDevicePathContainsFlowControl ^ ContainsFlowControl (DevicePath)) {\r
+            Status = EFI_UNSUPPORTED;\r
+          }\r
         }\r
         break;\r
       }\r
@@ -977,7 +978,7 @@ Returns:
   //The lower baud rate supported by the serial device will be selected without exceeding the unsupported BaudRate parameter\r
   // \r
   \r
-  for (Index = 1; Index < (sizeof (mBaudRateCurrentSupport) / sizeof (mBaudRateCurrentSupport[0])); Index++) {\r
+  for (Index = 1; Index < (ARRAY_SIZE (mBaudRateCurrentSupport)); Index++) {\r
     if (BaudRate < mBaudRateCurrentSupport[Index]) {\r
       BaudRate = mBaudRateCurrentSupport[Index-1];\r
       break;\r