Revision: 19269
          http://sourceforge.net/p/edk2/code/19269
Author:   vanjeff
Date:     2015-12-15 05:59:34 +0000 (Tue, 15 Dec 2015)
Log Message:
-----------
MdeModulePkg/PciSioSerialDxe: Fix compiler warnings

Add missing braces in module global mControllerDevicePathTemplate.
Initialize ControllerNumber and ContainsControllerNode in
SerialControllerDriverStart() to address warning for potential use
before initialization warning.
Move initialization of local SerialIo earlier in
SerialControllerDriverStart() to address warning for potential use
before initialization warning.

(Sync patch r19232 from main trunk.)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <[email protected]>
Reviewed-by: Feng Tian <[email protected]>

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/19232

Modified Paths:
--------------
    branches/UDK2015/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c

Modified: branches/UDK2015/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c
===================================================================
--- branches/UDK2015/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c      
2015-12-15 05:53:46 UTC (rev 19268)
+++ branches/UDK2015/MdeModulePkg/Bus/Pci/PciSioSerialDxe/Serial.c      
2015-12-15 05:59:34 UTC (rev 19269)
@@ -31,8 +31,10 @@
   {
     HARDWARE_DEVICE_PATH,
     HW_CONTROLLER_DP,
-    sizeof (CONTROLLER_DEVICE_PATH),
-    0
+    {
+      (UINT8) (sizeof (CONTROLLER_DEVICE_PATH)),
+      (UINT8) ((sizeof (CONTROLLER_DEVICE_PATH)) >> 8)
+    }
   },
   0
 };
@@ -858,7 +860,8 @@
     return EFI_SUCCESS;
   }
 
-
+  ControllerNumber = 0;
+  ContainsControllerNode = FALSE;
   SerialDevices = GetChildSerialDevices (Controller, IoProtocolGuid, 
&SerialDeviceCount);
   //
   // If the SerialIo instance specified by RemainingDevicePath is already 
created,
@@ -870,6 +873,7 @@
       if ((!SerialDevices[Index]->ContainsControllerNode && 
!ContainsControllerNode) ||
           (SerialDevices[Index]->ContainsControllerNode && 
ContainsControllerNode && SerialDevices[Index]->Instance == ControllerNumber)
           ) {
+        SerialIo = &SerialDevices[Index]->SerialIo;
         Status = EFI_INVALID_PARAMETER;
         //
         // Pass NULL ActualBaudRate to VerifyUartParameters to disallow 
baudrate degrade.
@@ -877,7 +881,6 @@
         //
         if (VerifyUartParameters (SerialDevices[Index]->ClockRate, 
Uart->BaudRate, Uart->DataBits,
                                   (EFI_PARITY_TYPE) Uart->Parity, 
(EFI_STOP_BITS_TYPE) Uart->StopBits, NULL, NULL)) {
-          SerialIo = &SerialDevices[Index]->SerialIo;
           Status = SerialIo->SetAttributes (
                                SerialIo,
                                Uart->BaudRate,


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to