From 654dc3ed852aafa126e9d539b7002db348dd6eb0 Mon Sep 17 00:00:00 2001 From: Pierre Gondois Date: Fri, 26 Jun 2020 16:28:04 +0100 Subject: [PATCH] ArmPkg/ArmMmuLib: Fix implicit cast While building with the following command line: build -b DEBUG -a AARCH64 -t VS2017 -p MdeModulePkg\MdeModulePkg.dsc A missing cast triggers the following warning, then triggering an error: ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c(652): warning C4152: nonstandard extension, function/data pointer conversion in expression This patch first casts the function pointer to (UINTN), then to (VOID *), followowing the C99 standard s6.3.2.3 "Pointer", paragraphs 5 and 6. This suppresses the warning. Signed-off-by: Pierre Gondois Suggested-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c index 222ff817956f..513a763e6e87 100644 --- a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c +++ b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c @@ -649,7 +649,7 @@ ArmMmuBaseLibConstructor ( // The ArmReplaceLiveTranslationEntry () helper function may be invoked // with the MMU off so we have to ensure that it gets cleaned to the PoC // - WriteBackDataCacheRange (ArmReplaceLiveTranslationEntry, + WriteBackDataCacheRange ((VOID *)(UINTN)ArmReplaceLiveTranslationEntry, ArmReplaceLiveTranslationEntrySize); return RETURN_SUCCESS;