public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] ArmPlatformPkg/NorFlashDxe: eliminate void pointer arithmetic
@ 2016-10-24 13:01 Ard Biesheuvel
  2016-10-24 13:05 ` Laszlo Ersek
  0 siblings, 1 reply; 4+ messages in thread
From: Ard Biesheuvel @ 2016-10-24 13:01 UTC (permalink / raw)
  To: edk2-devel; +Cc: leif.lindholm, lersek, Ard Biesheuvel

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;
 }
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-10-24 16:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-24 13:01 [PATCH] ArmPlatformPkg/NorFlashDxe: eliminate void pointer arithmetic Ard Biesheuvel
2016-10-24 13:05 ` Laszlo Ersek
2016-10-24 15:36   ` Ryan Harkin
2016-10-24 16:25     ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox