Taking the address of a cast expression is not permitted in C. Instead, take the address of the variable, and cast the pointer to the desired pointer type.
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org> --- IntelUndiPkg/GigUndiDxe/e1000.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IntelUndiPkg/GigUndiDxe/e1000.c b/IntelUndiPkg/GigUndiDxe/e1000.c index 4c9a06b8cf73..28c900e3ad63 100644 --- a/IntelUndiPkg/GigUndiDxe/e1000.c +++ b/IntelUndiPkg/GigUndiDxe/e1000.c @@ -1107,7 +1107,7 @@ E1000TxRxConfigure ( // Set the MemPtr to the high dword of the rx_ring so we can store it in RDBAH0. // Right shifts do not seem to work with the EFI compiler so we do it like this for now. MemAddr = (UINT64) (UINTN) GigAdapter->RxRing.PhysicalAddress; - MemPtr = &((UINT32) MemAddr); + MemPtr = (UINT32 *)&MemAddr; MemPtr++; E1000_WRITE_REG (&GigAdapter->Hw, E1000_RDBAH (0), *MemPtr); @@ -1185,7 +1185,7 @@ E1000TxRxConfigure ( E1000_WRITE_REG (&GigAdapter->Hw, E1000_TDBAL (0), (UINT32) (UINTN) (GigAdapter->TxRing.PhysicalAddress)); MemAddr = (UINT64) (UINTN) GigAdapter->TxRing.PhysicalAddress; - MemPtr = &((UINT32) MemAddr); + MemPtr = (UINT32 *)&MemAddr; MemPtr++; E1000_WRITE_REG (&GigAdapter->Hw, E1000_TDBAH (0), *MemPtr); DEBUGPRINT (E1000, ("TdBah0 %X\n", *MemPtr)); -- 2.19.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel