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>
This commit is contained in:
Pierre Gondois 2020-12-10 13:09:30 +00:00 committed by mergify[bot]
parent fd5c9bedbc
commit 88a7d4aa30
1 changed files with 6 additions and 4 deletions

View File

@ -90,8 +90,9 @@ AllocateFCB (
VOID VOID
) )
{ {
SEMIHOST_FCB *Fcb = AllocateZeroPool (sizeof (SEMIHOST_FCB)); SEMIHOST_FCB *Fcb;
Fcb = AllocateZeroPool (sizeof (SEMIHOST_FCB));
if (Fcb != NULL) { if (Fcb != NULL) {
CopyMem (&Fcb->File, &gSemihostFsFile, sizeof (gSemihostFsFile)); CopyMem (&Fcb->File, &gSemihostFsFile, sizeof (gSemihostFsFile));
Fcb->Signature = SEMIHOST_FCB_SIGNATURE; Fcb->Signature = SEMIHOST_FCB_SIGNATURE;
@ -122,7 +123,7 @@ VolumeOpen (
OUT EFI_FILE **Root OUT EFI_FILE **Root
) )
{ {
SEMIHOST_FCB *RootFcb = NULL; SEMIHOST_FCB *RootFcb;
if (Root == NULL) { if (Root == NULL) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
@ -759,12 +760,13 @@ GetFileInfo (
OUT VOID *Buffer OUT VOID *Buffer
) )
{ {
EFI_FILE_INFO *Info = NULL; EFI_FILE_INFO *Info;
UINTN NameSize = 0; UINTN NameSize;
UINTN ResultSize; UINTN ResultSize;
UINTN Index; UINTN Index;
if (Fcb->IsRoot) { if (Fcb->IsRoot) {
NameSize = 0;
ResultSize = SIZE_OF_EFI_FILE_INFO + sizeof(CHAR16); ResultSize = SIZE_OF_EFI_FILE_INFO + sizeof(CHAR16);
} else { } else {
NameSize = AsciiStrLen (Fcb->FileName) + 1; NameSize = AsciiStrLen (Fcb->FileName) + 1;