X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=sidebyside;f=Nt32Pkg%2FWinNtSerialIoDxe%2FWinNtSerialIo.c;h=96167d572370ef88b60bd72e908bea6538e70e67;hb=4d5d7812786db947e476b4d850698b465d0e2d99;hp=bd7424738778688abc7b51154a3737d866a763ae;hpb=8f2a5f8012e3a6de30f5b12ce3a218efae9eaedd;p=mirror_edk2.git diff --git a/Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIo.c b/Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIo.c index bd74247387..96167d5723 100644 --- a/Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIo.c +++ b/Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIo.c @@ -1,13 +1,7 @@ /**@file Copyright (c) 2006 - 2010, 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 -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +SPDX-License-Identifier: BSD-2-Clause-Patent Module Name: @@ -175,6 +169,7 @@ Returns: EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer; UINTN EntryCount; UINTN Index; + BOOLEAN RemainingDevicePathContainsFlowControl; // // Check RemainingDevicePath validation @@ -261,6 +256,11 @@ Returns: return Status; } + // + // See if RemainingDevicePath has a Flow Control device path node + // + RemainingDevicePathContainsFlowControl = ContainsFlowControl (RemainingDevicePath); + for (Index = 0; Index < EntryCount; Index++) { if ((OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) { Status = gBS->OpenProtocol ( @@ -271,9 +271,10 @@ Returns: Handle, EFI_OPEN_PROTOCOL_GET_PROTOCOL ); - if (!EFI_ERROR (Status) && - (ContainsFlowControl (RemainingDevicePath) ^ ContainsFlowControl (DevicePath))) { - Status = EFI_UNSUPPORTED; + if (!EFI_ERROR (Status)) { + if (RemainingDevicePathContainsFlowControl ^ ContainsFlowControl (DevicePath)) { + Status = EFI_UNSUPPORTED; + } } break; } @@ -977,7 +978,7 @@ Returns: //The lower baud rate supported by the serial device will be selected without exceeding the unsupported BaudRate parameter // - for (Index = 1; Index < (sizeof (mBaudRateCurrentSupport) / sizeof (mBaudRateCurrentSupport[0])); Index++) { + for (Index = 1; Index < (ARRAY_SIZE (mBaudRateCurrentSupport)); Index++) { if (BaudRate < mBaudRateCurrentSupport[Index]) { BaudRate = mBaudRateCurrentSupport[Index-1]; break;