summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/BaseSerialPortLib16550
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2016-01-11 00:34:15 +0000
committerhwu1225 <hwu1225@Edk2>2016-01-11 00:34:15 +0000
commit4977ee965f110069bf5e8a66f7d4b345995ef282 (patch)
treeda540b185d5c4a13912ccdddf27fbfdec9af6f39 /MdeModulePkg/Library/BaseSerialPortLib16550
parentc96bf1ff2c699622a4ee28e810497f64fe666c1a (diff)
downloadedk2-4977ee965f110069bf5e8a66f7d4b345995ef282.zip
edk2-4977ee965f110069bf5e8a66f7d4b345995ef282.tar.gz
edk2-4977ee965f110069bf5e8a66f7d4b345995ef282.tar.bz2
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
Diffstat (limited to 'MdeModulePkg/Library/BaseSerialPortLib16550')
-rw-r--r--MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
index f4fc319..0ccac96 100644
--- a/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
+++ b/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.c
@@ -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;
}
}