EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer;\r
UINTN EntryCount;\r
UINTN Index;\r
+ BOOLEAN RemainingDevicePathContainsFlowControl; \r
\r
//\r
// Check RemainingDevicePath validation\r
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
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
//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