summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Gondois <Pierre.Gondois@arm.com>2020-12-10 13:09:30 +0000
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-01-06 16:22:54 +0000
commit88a7d4aa30a42e1fee8c6eb6972bb1a9260103fc (patch)
tree200c7e219e7d717cc33f7189eb01ed74cc21f6c0
parentfd5c9bedbc0e49aefd9ee36abe11701c773b602e (diff)
downloadedk2-88a7d4aa30a42e1fee8c6eb6972bb1a9260103fc.tar.gz
edk2-88a7d4aa30a42e1fee8c6eb6972bb1a9260103fc.tar.bz2
edk2-88a7d4aa30a42e1fee8c6eb6972bb1a9260103fc.zip
ArmPkg: Fix Ecc error 5007 in SemihostFs
This patch fixes the following Ecc reported error: There should be no initialization of a variable as part of its declaration Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
-rw-r--r--ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
index 230f971f8b..6a06b38ab9 100644
--- a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
+++ b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c
@@ -90,8 +90,9 @@ AllocateFCB (
VOID
)
{
- SEMIHOST_FCB *Fcb = AllocateZeroPool (sizeof (SEMIHOST_FCB));
+ SEMIHOST_FCB *Fcb;
+ Fcb = AllocateZeroPool (sizeof (SEMIHOST_FCB));
if (Fcb != NULL) {
CopyMem (&Fcb->File, &gSemihostFsFile, sizeof (gSemihostFsFile));
Fcb->Signature = SEMIHOST_FCB_SIGNATURE;
@@ -122,7 +123,7 @@ VolumeOpen (
OUT EFI_FILE **Root
)
{
- SEMIHOST_FCB *RootFcb = NULL;
+ SEMIHOST_FCB *RootFcb;
if (Root == NULL) {
return EFI_INVALID_PARAMETER;
@@ -759,12 +760,13 @@ GetFileInfo (
OUT VOID *Buffer
)
{
- EFI_FILE_INFO *Info = NULL;
- UINTN NameSize = 0;
+ EFI_FILE_INFO *Info;
+ UINTN NameSize;
UINTN ResultSize;
UINTN Index;
if (Fcb->IsRoot) {
+ NameSize = 0;
ResultSize = SIZE_OF_EFI_FILE_INFO + sizeof(CHAR16);
} else {
NameSize = AsciiStrLen (Fcb->FileName) + 1;