From: Laszlo Ersek <lersek@redhat.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>, edk2-devel@ml01.01.org
Cc: leif.lindholm@linaro.org
Subject: Re: [PATCH] ArmPlatformPkg/NorFlashDxe: eliminate void pointer arithmetic
Date: Mon, 24 Oct 2016 15:05:04 +0200 [thread overview]
Message-ID: <d04a7f46-1fe8-d748-22f7-6dbd8312b72b@redhat.com> (raw)
In-Reply-To: <1477314075-18874-1-git-send-email-ard.biesheuvel@linaro.org>
On 10/24/16 15:01, Ard Biesheuvel wrote:
> While most compilers happily allow arithmetic on void pointer,
> the RVCT compiler does not, and throws the following warning for
> NorFlashDxe:
>
> ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c(894,48) :
> error #1254-D: arithmetic on pointer to void or function type
>
> Since the expression in question involves a cast from UINTN to VOID*,
> simply add some parentheses to eliminate this warning.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
> ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
> index ca61ac5e1983..1098d9501cc7 100644
> --- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
> +++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
> @@ -891,7 +891,7 @@ NorFlashRead (
> SEND_NOR_COMMAND (Instance->DeviceBaseAddress, 0, P30_CMD_READ_ARRAY);
>
> // Readout the data
> - AlignedCopyMem (Buffer, (VOID *)StartAddress + Offset, BufferSizeInBytes);
> + AlignedCopyMem (Buffer, (VOID *)(StartAddress + Offset), BufferSizeInBytes);
>
> return EFI_SUCCESS;
> }
>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
next prev parent reply other threads:[~2016-10-24 13:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-24 13:01 [PATCH] ArmPlatformPkg/NorFlashDxe: eliminate void pointer arithmetic Ard Biesheuvel
2016-10-24 13:05 ` Laszlo Ersek [this message]
2016-10-24 15:36 ` Ryan Harkin
2016-10-24 16:25 ` 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=d04a7f46-1fe8-d748-22f7-6dbd8312b72b@redhat.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