]> git.proxmox.com Git - mirror_edk2.git/commitdiff
PcAtChipsetPkg SerialIoLib: Fix VS2010 build error
authorHao Wu <hao.a.wu@intel.com>
Mon, 11 Jan 2016 00:34:36 +0000 (00:34 +0000)
committerhwu1225 <hwu1225@Edk2>
Mon, 11 Jan 2016 00:34:36 +0000 (00:34 +0000)
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@19629 6f19259b-4bc3-4df7-8a09-765794883524

PcAtChipsetPkg/Library/SerialIoLib/SerialPortLib.c

index 8656785347b281dc58039e3c8b999b0871592e8d..1bbb1a258411e410e06d7c63b3194f4371e41a2d 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   UART Serial Port library functions\r
 \r
-  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2016, 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
@@ -417,14 +417,6 @@ SerialPortSetAttributes (
     return RETURN_INVALID_PARAMETER;\r
   }\r
 \r
-  if ((*Parity < NoParity) || (*Parity > SpaceParity)) {\r
-    return RETURN_INVALID_PARAMETER;\r
-  }\r
-\r
-  if ((*StopBits < OneStopBit) || (*StopBits > TwoStopBits)) {\r
-    return RETURN_INVALID_PARAMETER;\r
-  }\r
-\r
   //\r
   // Map 5..8 to 0..3\r
   //\r
@@ -452,7 +444,7 @@ SerialPortSetAttributes (
       break;\r
 \r
     default:\r
-      break;\r
+      return RETURN_INVALID_PARAMETER;\r
   }\r
 \r
   switch (*StopBits) {\r
@@ -466,7 +458,7 @@ SerialPortSetAttributes (
       break;\r
 \r
     default:\r
-      break;\r
+      return RETURN_INVALID_PARAMETER;\r
   }\r
 \r
   //\r