]> git.proxmox.com Git - mirror_edk2.git/commit - ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c
ArmPlatformPkg/NorFlashDxe: correct NumOfLba vararg type in EraseBlocks()
authorLaszlo Ersek <lersek@redhat.com>
Thu, 18 May 2017 12:48:13 +0000 (14:48 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Thu, 18 May 2017 21:18:05 +0000 (23:18 +0200)
commitce69cc776cfcc4a0869907cd4263fd134064dbaf
tree712cdea07e611673611fb2f1889c7d847d859f58
parent7a85e8474127ae6df47337a04797b2b443b57682
ArmPlatformPkg/NorFlashDxe: correct NumOfLba vararg type in EraseBlocks()

According to the PI spec, Volume 3,
EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL.EraseBlocks():

> The variable argument list is a list of tuples. Each tuple describes a
> range of LBAs to erase and consists of the following:
> * An EFI_LBA that indicates the starting LBA
> * A UINTN that indicates the number of blocks to erase

(NB, in edk2, EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL is a typedef to
EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL.)

In this driver, the NumOfLba local variable is defined with type UINTN,
but the TYPE argument passed to VA_ARG() is UINT32. Fix the mismatch.

In addition, update the DEBUG macro invocation where NumOfLba is formatted
with the %d conversion specifier: UINTN values should be converted to
UINT64 and printed with %Lu or %Lx for portability between 32-bit and
64-bit.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Reported-by: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c