]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Initialize local variable value before they are used
authorLiming Gao <gaoliming@byosoft.com.cn>
Mon, 15 Mar 2021 02:55:47 +0000 (10:55 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 25 Mar 2021 01:54:46 +0000 (01:54 +0000)
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3228
This change is to fix the false compiler error on GCC49 release build.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.c

index e99a812a44e384c44cf1c18d2f7a82be7ea2cb50..1053695b3b625f9cf81f8fbcff64501e47caf830 100644 (file)
@@ -1127,6 +1127,11 @@ AhciDmaTransfer (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
+  //\r
+  // Set Status to suppress incorrect compiler/analyzer warnings\r
+  //\r
+  Status = EFI_SUCCESS;\r
+\r
   //\r
   // DMA buffer allocation. Needs to be done only once for both sync and async\r
   // DMA transfers irrespective of number of retries.\r
index 0c9299c8b0e149d3b0d673f8a0242d199321b539..6bcb95247f845d5d6c04c5d630922d27215d292b 100644 (file)
@@ -115,6 +115,11 @@ CreateBasicVariablePolicy (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
+  //\r
+  // Set NameSize to suppress incorrect compiler/analyzer warnings\r
+  //\r
+  NameSize  = 0;\r
+\r
   // Now we've gotta determine the total size of the buffer required for\r
   // the VariablePolicy structure.\r
   TotalSize = sizeof( VARIABLE_POLICY_ENTRY );\r