LcrParity and LcrStop may end up being referenced without being
initialized, so make sure they always have a value.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <[email protected]>
---
 PcAtChipsetPkg/Library/SerialIoLib/SerialPortLib.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/PcAtChipsetPkg/Library/SerialIoLib/SerialPortLib.c 
b/PcAtChipsetPkg/Library/SerialIoLib/SerialPortLib.c
index 8656785347b2..5698e935b01f 100644
--- a/PcAtChipsetPkg/Library/SerialIoLib/SerialPortLib.c
+++ b/PcAtChipsetPkg/Library/SerialIoLib/SerialPortLib.c
@@ -432,6 +432,7 @@ SerialPortSetAttributes (
 
   switch (*Parity) {
     case NoParity:
+    case DefaultParity:
       LcrParity = 0;
       break;
 
@@ -450,13 +451,11 @@ SerialPortSetAttributes (
     case MarkParity:
       LcrParity = 5;
       break;
-
-    default:
-      break;
   }
 
   switch (*StopBits) {
     case OneStopBit:
+    case DefaultStopBits:
       LcrStop = 0;
       break;
 
@@ -464,9 +463,6 @@ SerialPortSetAttributes (
     case TwoStopBits:
       LcrStop = 1;
       break;
-
-    default:
-      break;
   }
 
   //
-- 
2.5.0

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to