From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::444; helo=mail-pf1-x444.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 19DD62119073A for ; Wed, 14 Nov 2018 18:34:20 -0800 (PST) Received: by mail-pf1-x444.google.com with SMTP id v68-v6so8910414pfk.0 for ; Wed, 14 Nov 2018 18:34:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aseRhwKhZyCp0AXOSzd/RejiRY1+oa9MAnJC3d4QZSU=; b=YoouDz4f4amrHv6a9NPICSkqlZ+mdoFu0Yc6px+2LXMBEx+uSJDkfXhq6NSpkJ3d5u SAAQaSZUeTVl3Aja5Ewi0IcViDaN0kyxqiUSd3wO4bnYAkVAova178FXOa4CSTjRNj6F cuv72goSOdSXosK0mdkDjL+RsSmeuspNlU6N0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aseRhwKhZyCp0AXOSzd/RejiRY1+oa9MAnJC3d4QZSU=; b=SukJGru6NivOPp4yJf6NcRwXX7aBPQzKfgAqpyQFqDTlc4rXOliXFin+LzG9JZ7oGM S/vyhT0xOtTfcjB+KZYB09M+kvIIGr/CIHq8q4TDZCyrJDj2knL83PUCiQAFmw5/K55c EIV98XF/JUvVdP4PX8BtKXl4pU2ZBXNJTtbLa9fo5X2o4JfEjh+b2l7al85hCcgUn62t 0dZeMvFkSfXxd+E5JTAdL33UFTC1F+AD5dDLvOo3ZvzAJGodDo3/2zykkfuHDfVP4mc1 07IjtodNrchzIpbHqsUaRZ5Zr0cvWoRTpFyHvxgiewC2hulrf8UkSlKMDxz7ujoUCYCS GGfg== X-Gm-Message-State: AGRZ1gJticnIcjnbPfqU0v6sDLFZqqkxgXpHY61OocHjPi2KU7SDddyZ kExfztPowBr0LtaI7B2iQyi/NaveAd9Ehg== X-Google-Smtp-Source: AJdET5fEEZpvZdIDGyg48go7P0UZyGpw1sJ2JcwDAcfIwKKugQTNXSym7n24Y7TuH6PChzEH8DiiOA== X-Received: by 2002:a63:d441:: with SMTP id i1-v6mr4070513pgj.31.1542249259493; Wed, 14 Nov 2018 18:34:19 -0800 (PST) Received: from mba13.psav.com ([64.114.255.97]) by smtp.gmail.com with ESMTPSA id v185-v6sm27323393pfv.48.2018.11.14.18.34.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Nov 2018 18:34:18 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, maciej.rabeda@intel.com, kamil.kacperski@intel.com, pawel.orlowski@intel.com, philmd@redhat.com, michael.d.kinney@intel.com, harry.l.hsiung@intel.com, eric.jin@intel.com, Ard Biesheuvel Date: Wed, 14 Nov 2018 18:33:48 -0800 Message-Id: <20181115023353.20159-16-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181115023353.20159-1-ard.biesheuvel@linaro.org> References: <20181115023353.20159-1-ard.biesheuvel@linaro.org> Subject: [PATCH edk2-staging 15/20] IntelUndiPkg/XGigUndiDxe: use intermediate UINTN casts for pointers X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2018 02:34:20 -0000 Use intermediate (UINTN) casts when casting pointers to UINT64. This is needed to be able to build this code for 32-bit architectures such as ARM or IA32. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- IntelUndiPkg/XGigUndiDxe/Dma.c | 8 ++++---- IntelUndiPkg/XGigUndiDxe/DriverDiagnostics.c | 4 ++-- IntelUndiPkg/XGigUndiDxe/Init.c | 6 +++--- IntelUndiPkg/XGigUndiDxe/Xgbe.c | 8 ++++---- IntelUndiPkg/XGigUndiDxe/Xgbe.h | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/IntelUndiPkg/XGigUndiDxe/Dma.c b/IntelUndiPkg/XGigUndiDxe/Dma.c index c8588df96ef5..79a5cefe9f41 100644 --- a/IntelUndiPkg/XGigUndiDxe/Dma.c +++ b/IntelUndiPkg/XGigUndiDxe/Dma.c @@ -127,7 +127,7 @@ FREE_BUF_ON_ERROR: PciIo->FreeBuffer ( PciIo, BytesToPages (DmaMapping->Size), - (VOID *) DmaMapping->UnmappedAddress + (VOID *)(UINTN)DmaMapping->UnmappedAddress ); DmaMapping->Size = 0; DmaMapping->UnmappedAddress = 0; @@ -173,7 +173,7 @@ UndiDmaFreeCommonBuffer ( PciIo->FreeBuffer ( PciIo, BytesToPages (DmaMapping->Size), - (VOID *) DmaMapping->UnmappedAddress + (VOID *)(UINTN)DmaMapping->UnmappedAddress ); DmaMapping->UnmappedAddress = 0; @@ -209,7 +209,7 @@ UndiDmaMapCommonBuffer ( return PciIo->Map ( PciIo, EfiPciIoOperationBusMasterCommonBuffer, - (VOID *) DmaMapping->UnmappedAddress, + (VOID *)(UINTN)DmaMapping->UnmappedAddress, &DmaMapping->Size, &DmaMapping->PhysicalAddress, &DmaMapping->Mapping @@ -243,7 +243,7 @@ UndiDmaMapMemoryRead ( return PciIo->Map ( PciIo, EfiPciIoOperationBusMasterRead, - (VOID *) DmaMapping->UnmappedAddress, + (VOID *)(UINTN)DmaMapping->UnmappedAddress, &DmaMapping->Size, &DmaMapping->PhysicalAddress, &DmaMapping->Mapping diff --git a/IntelUndiPkg/XGigUndiDxe/DriverDiagnostics.c b/IntelUndiPkg/XGigUndiDxe/DriverDiagnostics.c index 66dc67a5400e..2f9c66771910 100644 --- a/IntelUndiPkg/XGigUndiDxe/DriverDiagnostics.c +++ b/IntelUndiPkg/XGigUndiDxe/DriverDiagnostics.c @@ -119,11 +119,11 @@ XgbeUndiRunPhyLoopback ( DEBUGPRINT (DIAG, ("CpbReceive.BufferAddr allocated at %x\n", (UINTN) CpbReceive.BufferAddr)); while (j < PHY_LOOPBACK_ITERATIONS) { - ZeroMem ((VOID *) CpbReceive.BufferAddr, RX_BUFFER_SIZE); + ZeroMem ((VOID *)(UINTN)CpbReceive.BufferAddr, RX_BUFFER_SIZE); Status = XgbeTransmit ( XgbeAdapter, - (UINT64) &PxeCpbTransmit, + (UINT64)(UINTN)&PxeCpbTransmit, PXE_OPFLAGS_TRANSMIT_WHOLE ); diff --git a/IntelUndiPkg/XGigUndiDxe/Init.c b/IntelUndiPkg/XGigUndiDxe/Init.c index 03e3942a1944..c112db667148 100644 --- a/IntelUndiPkg/XGigUndiDxe/Init.c +++ b/IntelUndiPkg/XGigUndiDxe/Init.c @@ -260,7 +260,7 @@ InitUndiPxeStructInit ( PXE_ROMID_IMP_TX_COMPLETE_INT_SUPPORTED | PXE_ROMID_IMP_PACKET_RX_INT_SUPPORTED; - PxePtr->EntryPoint = (UINT64) UndiApiEntry; + PxePtr->EntryPoint = (UINT64)(UINTN)UndiApiEntry; PxePtr->MinorVer = PXE_ROMID_MINORVER_31; PxePtr->reserved2[0] = 0; @@ -1099,7 +1099,7 @@ InitUndiCallbackFunctions ( NicInfo->MapMem = (VOID *) 0; NicInfo->UnMapMem = (VOID *) 0; NicInfo->SyncMem = (VOID *) 0; - NicInfo->UniqueId = (UINT64) NicInfo; + NicInfo->UniqueId = (UINT64)(UINTN)NicInfo; NicInfo->VersionFlag = 0x31; } @@ -1284,7 +1284,7 @@ InitNiiProtocol ( EFI_STATUS Status; - NiiProtocol31->Id = (UINT64) (mIxgbePxe31); + NiiProtocol31->Id = (UINT64)(UINTN)(mIxgbePxe31); // IFcnt should be equal to the total number of physical ports - 1 NiiProtocol31->IfNum = mIxgbePxe31->IFcnt; diff --git a/IntelUndiPkg/XGigUndiDxe/Xgbe.c b/IntelUndiPkg/XGigUndiDxe/Xgbe.c index 003c3b9065ec..6769f2dc72ab 100644 --- a/IntelUndiPkg/XGigUndiDxe/Xgbe.c +++ b/IntelUndiPkg/XGigUndiDxe/Xgbe.c @@ -1237,7 +1237,7 @@ XgbeTxRxConfigure ( ZeroMem (XgbeAdapter->TxBufferMappings, sizeof (XgbeAdapter->TxBufferMappings)); - RxBuffer = (LOCAL_RX_BUFFER *) XgbeAdapter->RxBufferMapping.PhysicalAddress; + RxBuffer = (LOCAL_RX_BUFFER *)(UINTN)XgbeAdapter->RxBufferMapping.PhysicalAddress; DEBUGPRINT ( XGBE, ("Local Rx Buffer %X size %X\n", @@ -1407,17 +1407,17 @@ XgbeInitialize ( TempBar = NULL; ZeroMem ( - (VOID *) XgbeAdapter->RxRing.UnmappedAddress, + (VOID *)(UINTN)XgbeAdapter->RxRing.UnmappedAddress, RX_RING_SIZE ); ZeroMem ( - (VOID *) XgbeAdapter->TxRing.UnmappedAddress, + (VOID *)(UINTN)XgbeAdapter->TxRing.UnmappedAddress, TX_RING_SIZE ); ZeroMem ( - (VOID *) XgbeAdapter->RxBufferMapping.UnmappedAddress, + (VOID *)(UINTN)XgbeAdapter->RxBufferMapping.UnmappedAddress, RX_BUFFERS_SIZE ); diff --git a/IntelUndiPkg/XGigUndiDxe/Xgbe.h b/IntelUndiPkg/XGigUndiDxe/Xgbe.h index 4472cfb4fa31..2a904de5bf2f 100644 --- a/IntelUndiPkg/XGigUndiDxe/Xgbe.h +++ b/IntelUndiPkg/XGigUndiDxe/Xgbe.h @@ -221,7 +221,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @return Descriptor retrieved **/ #define XGBE_RX_DESC(R, i) \ - (&(((struct ixgbe_legacy_rx_desc *) ((R)->UnmappedAddress))[i])) + (&(((struct ixgbe_legacy_rx_desc *)(UINTN)((R)->UnmappedAddress))[i])) /** Retrieves TX descriptor from TX ring structure @@ -231,7 +231,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @return Descriptor retrieved **/ #define XGBE_TX_DESC(R, i) \ - (&(((struct ixgbe_legacy_tx_desc *) ((R)->UnmappedAddress))[i])) + (&(((struct ixgbe_legacy_tx_desc *)(UINTN)((R)->UnmappedAddress))[i])) /** Retrieves UNDI_PRIVATE_DATA structure using NII Protocol 3.1 instance -- 2.17.1