mirror of https://github.com/acidanthera/audk.git
MdeModulePkg BaseSerialPortLib: Fix VS2010 build error
When overriding compiler options '/GL' with '/GL-', VS2010 will report warning C4701 potentially uninitialized local variable for 'LcrParity' and 'LcrStop' in function SerialPortSetAttributes(). This commit fixes this build issue. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19628 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
c96bf1ff2c
commit
4977ee965f
|
@ -2,7 +2,7 @@
|
|||
16550 UART Serial Port library functions
|
||||
|
||||
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
|
||||
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -1006,9 +1006,6 @@ SerialPortSetAttributes (
|
|||
break;
|
||||
}
|
||||
} else {
|
||||
if ((*Parity < NoParity) || (*Parity > SpaceParity)) {
|
||||
return RETURN_INVALID_PARAMETER;
|
||||
}
|
||||
switch (*Parity) {
|
||||
case NoParity:
|
||||
LcrParity = 0;
|
||||
|
@ -1031,7 +1028,7 @@ SerialPortSetAttributes (
|
|||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
return RETURN_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1054,9 +1051,6 @@ SerialPortSetAttributes (
|
|||
break;
|
||||
}
|
||||
} else {
|
||||
if ((*StopBits < OneStopBit) || (*StopBits > TwoStopBits)) {
|
||||
return RETURN_INVALID_PARAMETER;
|
||||
}
|
||||
switch (*StopBits) {
|
||||
case OneStopBit:
|
||||
LcrStop = 0;
|
||||
|
@ -1068,7 +1062,7 @@ SerialPortSetAttributes (
|
|||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
return RETURN_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue