public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "PierreGondois" <pierre.gondois@arm.com>
To: devel@edk2.groups.io
Cc: Pierre Gondois <Pierre.Gondois@arm.com>,
	leif@nuviainc.com, ard.biesheuvel@arm.com, lersek@redhat.com,
	nd@arm.com
Subject: [PATCH v2 1/1] ArmPkg/ArmMmuLibb: Fix implicit cast
Date: Fri, 26 Jun 2020 16:28:04 +0100	[thread overview]
Message-ID: <20200626152804.88820-1-pierre.gondois@arm.com> (raw)

From: Pierre Gondois <pierre.gondois@arm.com>

While building with the following command line:
build -b DEBUG -a AARCH64 -t VS2017 -p
edk2\MdeModulePkg\MdeModulePkg.dsc

A missing cast triggers the following warning,
then triggering an error:
edk2/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 allows to remove the
warning.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---

The changes can be seen at: https://github.com/PierreARM/edk2/commits/831_Fix_implicit_cast_v2

Notes:
    v1:
     - Add (void*) cast. [Pierre]
    v2:
     - First cast to (UINTN) to conform to c99 specification. [Lazlo]

 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 222ff817956feb738325fc78fbaf064de98802a9..5fcd410061f0f0940cd761819ab49f598e2b4b00 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;
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


             reply	other threads:[~2020-06-26 15:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26 15:28 PierreGondois [this message]
2020-06-27  9:05 ` [PATCH v2 1/1] ArmPkg/ArmMmuLibb: Fix implicit cast Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200626152804.88820-1-pierre.gondois@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox