]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
efi_loader: do not cast return value in EFI_EXIT
authorxypron.glpk@gmx.de <xypron.glpk@gmx.de>
Thu, 17 Aug 2017 16:57:36 +0000 (18:57 +0200)
committerAlexander Graf <agraf@suse.de>
Fri, 18 Aug 2017 08:53:23 +0000 (10:53 +0200)
UEFI API functions have different return types.
Some return a value of type EFI_STATUS other don't.

We therefore should not cast the return value of EFI_EXIT
to another type than the expression passed to EFI_EXIT.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
include/efi_loader.h

index 037cc7c543414682ebe05f11da5df17764a80a81..1179234f6836b6e7aaa942cbed3e1a701aee2737 100644 (file)
@@ -33,9 +33,9 @@ const char *__efi_nesting_dec(void);
  * Exit the u-boot world back to UEFI:
  */
 #define EFI_EXIT(ret) ({ \
-       efi_status_t _r = ret; \
+       typeof(ret) _r = ret; \
        debug("%sEFI: Exit: %s: %u\n", __efi_nesting_dec(), \
-               __func__, (u32)(_r & ~EFI_ERROR_MASK)); \
+               __func__, (u32)((uintptr_t) _r & ~EFI_ERROR_MASK)); \
        assert(__efi_exit_check()); \
        _r; \
        })