From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::444; helo=mail-wr1-x444.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450: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 09F8621131DCF for ; Tue, 6 Nov 2018 09:59:08 -0800 (PST) Received: by mail-wr1-x444.google.com with SMTP id y3-v6so14263033wrh.10 for ; Tue, 06 Nov 2018 09:59:07 -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 :mime-version:content-transfer-encoding; bh=kfAlwte03sNvPk5cgq3Y0fCYXpgLbvJxTdtNLfht1kA=; b=aWR/qQOwNKWzkdHf5U8YuMPa50aeAhHIl7G5jlaMdzwWqyF68+x4+SxFR42BcEuZhl WGPOO0VbLx5PdqnLkKPt+h/1zT6X/LnWQRmi1C53FO6zmCC3alhp2cmCvyufJO8j7ggO EQToGyKr35TlDkn09SYRH03RCXHQfMboVTAlo= 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:mime-version:content-transfer-encoding; bh=kfAlwte03sNvPk5cgq3Y0fCYXpgLbvJxTdtNLfht1kA=; b=TEonoWiKbzry/gWCsgqouebBd3AH6l59JfmlVu447GLTkkWKxYxSxzqYYbJH+EnpY0 OumSG7Cg9kMth9eG0THuB3RjuYYKdk5tPK0MCbpzhTg7lYrFp3wXCkeA3cjYOEbIhK2w zTdiQvPNoIUd8Grm+ia71fwBN3eWAvp2ewb91etdiEynQ63Qz/JecQgPb0xacmO3AjBK lf+ZeY37+fn0BQ0NYigiBDnwKGdOebmNdXT1j4OWYVsYfZHkUHdp7zJTQCmcj0nQzumJ qXXOv4Q7imkAnOaHAthDjrg0R+LxO5fQyDYRBEDnC70UM8/5d+4TaAo73Gp2K+gn4DA6 z+Pw== X-Gm-Message-State: AGRZ1gKrf/wSf5RZMnDTm/W2JXIzVXV7BvRGqx2MFFbnrGFciqXywo1E q9Hkip1sGQeUiTsC8upG8LeVFgxVghw= X-Google-Smtp-Source: AJdET5cQatJ2kXwb+BA2T07fMy85jBDFQphfTZQR+3YDHYkZT3z2AOahRPsE1VOf7owXcZFOe+YrYw== X-Received: by 2002:adf:a409:: with SMTP id d9-v6mr23924515wra.190.1541527146145; Tue, 06 Nov 2018 09:59:06 -0800 (PST) Received: from localhost.localdomain (laubervilliers-657-1-83-120.w92-154.abo.wanadoo.fr. [92.154.90.120]) by smtp.gmail.com with ESMTPSA id 134-v6sm2971522wmp.6.2018.11.06.09.59.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Nov 2018 09:59:05 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Cc: maciej.rabeda@intel.com, michael.d.kinney@intel.com, eric.jin@intel.com, leif.lindholm@linaro.org, Ard Biesheuvel Date: Tue, 6 Nov 2018 18:58:27 +0100 Message-Id: <20181106175833.26964-14-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181106175833.26964-1-ard.biesheuvel@linaro.org> References: <20181106175833.26964-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [PATCH edk2-staging 13/19] IntelUndiPkg/GigUndiDxe: don't take address of cast expression 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: Tue, 06 Nov 2018 17:59:08 -0000 Content-Transfer-Encoding: 8bit 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 --- 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