[edk2] [PATCH 05/12] OvmfPkg/IoMmuDxe: don't initialize local variables

Laszlo Ersek posted 12 patches 7 years, 4 months ago
[edk2] [PATCH 05/12] OvmfPkg/IoMmuDxe: don't initialize local variables
Posted by Laszlo Ersek 7 years, 4 months ago
The edk2 coding style requires separate assignments.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 OvmfPkg/IoMmuDxe/IoMmuDxe.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/OvmfPkg/IoMmuDxe/IoMmuDxe.c b/OvmfPkg/IoMmuDxe/IoMmuDxe.c
index 5809afc44196..27b1856e0a17 100644
--- a/OvmfPkg/IoMmuDxe/IoMmuDxe.c
+++ b/OvmfPkg/IoMmuDxe/IoMmuDxe.c
@@ -31,23 +31,27 @@ EFIAPI
 IoMmuDxeEntryPoint (
   IN EFI_HANDLE         ImageHandle,
   IN EFI_SYSTEM_TABLE   *SystemTable
   )
 {
-  EFI_STATUS    Status = EFI_SUCCESS;
-  EFI_HANDLE    Handle = NULL;
+  EFI_STATUS    Status;
+  EFI_HANDLE    Handle;
+
+  Status = EFI_SUCCESS;
 
   //
   // When SEV is enabled, install IoMmu protocol otherwise install the
   // placeholder protocol so that other dependent module can run.
   //
   if (MemEncryptSevIsEnabled ()) {
     AmdSevInstallIoMmuProtocol ();
   } else {
+    Handle = NULL;
+
     Status = gBS->InstallMultipleProtocolInterfaces (
                   &Handle,
                   &gIoMmuAbsentProtocolGuid,
                   NULL, NULL);
   }
 
   return Status;
 }
-- 
2.13.1.3.g8be5a757fa67


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel