]> git.proxmox.com Git - mirror_edk2.git/commit - ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c
ArmPkg: Fix bug in Generic Watchdog driver
authorAlexeiFedorov <alexei.fedorov@arm.com>
Fri, 27 Apr 2018 13:58:43 +0000 (14:58 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 30 Apr 2018 09:38:54 +0000 (11:38 +0200)
commit8fe18cba7694a1d95699a08ff2491ffa04b0661d
tree4d3fc7678d9458605073b7105d1fff81ec7f20f6
parentf9dff90289507191f299331e44601c5ef83c1948
ArmPkg: Fix bug in Generic Watchdog driver

In ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c, the following
functions:

  WatchdogWriteOffsetRegister()
  WatchdogWriteCompareRegister()
  WatchdogEnable()
  WatchdogDisable()

provide write access to ARM Generic Watchdog registers and use the values
returned by MmioWrite32() and MmioWrite64() as EFI_STATUS return codes.

Because MmioWriteXY() return the value passed as its write parameter,
Generic Watchdog access functions can spuriously return error codes which
are different from EFI_SUCCESS, e.g. the following call

    Status = WatchdogWriteOffsetRegister (MAX_UINT32);
    if (EFI_ERROR (Status)) {
      return Status;
    }

will return MAX_UINT32 defined in MdePkg/Include/Base.h as

 #define MAX_UINT32  ((UINT32)0xFFFFFFFF)

This commit declares all the functions listed above as VOID
and removes the code for checking their return values.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Alexei Fedorov <alexei.fedorov@arm.com>
Reviewed-by: Evan Lloyd <evan.lloyd@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c