From patchwork Thu Nov 15 02:33:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 151152 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6454014ljp; Wed, 14 Nov 2018 18:35:08 -0800 (PST) X-Google-Smtp-Source: AJdET5eivnrlpnzmJh9AutkH+xO4zSCtD2XYEdYGw1pTwvsDUgZgTY+J8IkKl4fFZ07Lm2q5jsBE X-Received: by 2002:a6b:be41:: with SMTP id o62-v6mr3424579iof.255.1542249308292; Wed, 14 Nov 2018 18:35:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542249308; cv=none; d=google.com; s=arc-20160816; b=VVanZJ7ldpmG94R/VOLLbjg+7RRkry+5VYT2Ger+w/YAqNcPQHxOiL4R8O5Pmofo7l 42j0dPvRXjaW8t4p0VJoU0GJ0xYcE1iDPA0SrVNgliZJo+ePJ6A02x3GiTFIy8ykW+9x KAnQPrxHADvY1NMmHPop223AVVe78iUmEKp6S7Snm0RoqYYMh4x6vpediDz6fAFELi4t LNoCDR3/FFM+Gmo9/4Q9wI/GCTYGPWm8Ve92kClswNkVOEEC6uoSBm4OnvdRvAVZrflV b6f9R1csN7/aKdOCMc0bhvMGeMFs+joj6EjFm9QOi1BQ5uc+2umAvw50WXN4jM6zDQlU AhIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=VN3S2l049IqEIUfnfx2D6lDP3i6KSmQAbwrE+mmcGZg=; b=J/RM7Dde5aFHrXoABvzyF8nqjsWSonXHQMCT/z3UAWawiMibYgHCS4pLsZwqqX/8AD 7jV5S+dhfsuYC9prHTkvpmJg7pP8osCWetVGxavIQxTVa3n1sJCnPeOKcJ7R7GS9UhA+ NPizNUmYxvKufIdR+75ZmQl8aqDdJw//yvrFFZETW340GCvAwRvu6YhPN/xVu36EeTjk TBlHaquuqy9nbeyrWc5OFiW+ZJSpgz4JsZPCN8FyIiAikSDpo7TT52lR3Tky3KZG8HBf h7xJixwmLNmJP+bGbwi9qfoguONGTSS6jIDwND6KUKoEKE6T/UTPN9nN/MRv1XeGDgKG J4pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=YoouDz4f; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id m17si7218366jah.76.2018.11.14.18.35.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Nov 2018 18:35:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=YoouDz4f; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BEC4C2119173B; Wed, 14 Nov 2018 18:34:20 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org 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-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 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: [edk2] [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: , Cc: kamil.kacperski@intel.com, eric.jin@intel.com, pawel.orlowski@intel.com, michael.d.kinney@intel.com, harry.l.hsiung@intel.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(-) -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Ryszard Knop 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