[edk2] [platforms: PATCH 08/10] Marvell/Applications/SpiTool: Fix 32-bit issues

Marcin Wojtas posted 10 patches 7 years, 3 months ago
[edk2] [platforms: PATCH 08/10] Marvell/Applications/SpiTool: Fix 32-bit issues
Posted by Marcin Wojtas 7 years, 3 months ago
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Fix casting and related issues to make this code build for 32-bit ARM.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
---
 Platform/Marvell/Applications/SpiTool/SpiFlashCmd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Platform/Marvell/Applications/SpiTool/SpiFlashCmd.c b/Platform/Marvell/Applications/SpiTool/SpiFlashCmd.c
index e6e1007..9321f6b 100644
--- a/Platform/Marvell/Applications/SpiTool/SpiFlashCmd.c
+++ b/Platform/Marvell/Applications/SpiTool/SpiFlashCmd.c
@@ -211,7 +211,8 @@ EFI_STATUS              Status;
   LIST_ENTRY            *CheckPackage;
   EFI_PHYSICAL_ADDRESS  Address = 0, Offset = 0;
   SHELL_FILE_HANDLE     FileHandle = NULL;
-  UINTN                 ByteCount, FileSize, I;
+  UINTN                 ByteCount, I;
+  UINT64                FileSize;
   UINT8                 *Buffer = NULL, *FileBuffer = NULL;
   CHAR16                *ProblemParam, *FilePath;
   CONST CHAR16          *AddressStr = NULL, *OffsetStr = NULL;
@@ -418,7 +419,7 @@ EFI_STATUS              Status;
     }
   }
 
-  Buffer = (UINT8 *) Address;
+  Buffer = (UINT8 *)(UINTN)Address;
   if (FileFlag) {
     Buffer = FileBuffer;
   }
-- 
1.8.3.1

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