summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorLiming Gao <gaoliming@byosoft.com.cn>2021-03-15 10:55:47 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-03-25 01:54:46 +0000
commitaa75965349875f8c68b0c43b55b0c5e4799c1289 (patch)
tree327881f55b04e3aa4a2563b500fc0f3de0939a19 /MdeModulePkg
parentf037af6ecbc3b55042c998a59ed8df8548e64b99 (diff)
downloadedk2-aa75965349875f8c68b0c43b55b0c5e4799c1289.tar.gz
edk2-aa75965349875f8c68b0c43b55b0c5e4799c1289.tar.bz2
edk2-aa75965349875f8c68b0c43b55b0c5e4799c1289.zip
MdeModulePkg: Initialize local variable value before they are used
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>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c5
-rw-r--r--MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
index e99a812a44..1053695b3b 100644
--- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
+++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
@@ -1128,6 +1128,11 @@ AhciDmaTransfer (
}
//
+ // Set Status to suppress incorrect compiler/analyzer warnings
+ //
+ Status = EFI_SUCCESS;
+
+ //
// DMA buffer allocation. Needs to be done only once for both sync and async
// DMA transfers irrespective of number of retries.
//
diff --git a/MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.c b/MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.c
index 0c9299c8b0..6bcb95247f 100644
--- a/MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.c
+++ b/MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.c
@@ -115,6 +115,11 @@ CreateBasicVariablePolicy (
return EFI_INVALID_PARAMETER;
}
+ //
+ // Set NameSize to suppress incorrect compiler/analyzer warnings
+ //
+ NameSize = 0;
+
// Now we've gotta determine the total size of the buffer required for
// the VariablePolicy structure.
TotalSize = sizeof( VARIABLE_POLICY_ENTRY );