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::441; helo=mail-pf1-x441.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (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 59D812119073A for ; Wed, 14 Nov 2018 18:34:16 -0800 (PST) Received: by mail-pf1-x441.google.com with SMTP id h3so2352452pfg.1 for ; Wed, 14 Nov 2018 18:34:16 -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=WA0g9QT5X2CAPttE9SkZt34mDGB6oEyugFm2y8rhe5o=; b=kLDjHoGHrsKDD2Xe/EoBKSvNMyhjh9N9D6+Kqvi+Wm0AB3ap/jMefi1oA/G9q/L0mJ arIwayrwWWyPrblagreYTNfypFyRC45Je21781Dk4X0TFUtnsyQ1U6jGPSlI1eEEbECP 77FNYfrBwN3m+5+cUcHyzUqkkOpoix8G9l0zA= 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=WA0g9QT5X2CAPttE9SkZt34mDGB6oEyugFm2y8rhe5o=; b=neHbAHLs4EK4DoCGlNirVtCfKtb1uKhH61cETf3mOsB+MhoAhLMZYYTXSsR/ZVqsmt IkaZQH1AfCY6sZyRiiKwDu4zyAfOkEzXjquTgV6bfdCsmN4D7oTVh/D8T/gDEDu+T/BU WT5/GdwKtmWjrZQ5lV3GvefGtNzlNa75Po6kg3LVMR3WD2L4bvOUu36zTDTlID5nPKLr urMEG7H3oow1ueykF6bryCn4965mebaau5Sx2wMlsb1LKiauU525+3LgTBBmRPn80cFQ lYOdhueCIUv5tcUfHFna2QvG6NZCMDg1tR5aImb1mCSChFo8f3BbSSGCLoeDK0U/n/yq Vs1g== X-Gm-Message-State: AGRZ1gJheEFoOOWR5tAEtgD6yXFq9ozoCFNPDUENaXeCPuVI6desUhgm YABpcHXz/CIYRQB/uQhMP6jg0y2ZE8EwYQ== X-Google-Smtp-Source: AJdET5dslwOkzkhekGUYlhkUuOmIkrI2OIVVfEzMSNgRovj2wEvjoRityYTRDc9GVckXecPN83tVGQ== X-Received: by 2002:a63:7d06:: with SMTP id y6mr4103409pgc.171.1542249255757; Wed, 14 Nov 2018 18:34:15 -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.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Nov 2018 18:34:15 -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:45 -0800 Message-Id: <20181115023353.20159-13-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 12/20] IntelUndiPkg/XGigUndiDxe: 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: Thu, 15 Nov 2018 02:34:16 -0000 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/XGigUndiDxe/Xgbe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IntelUndiPkg/XGigUndiDxe/Xgbe.c b/IntelUndiPkg/XGigUndiDxe/Xgbe.c index 0c823efe8963..003c3b9065ec 100644 --- a/IntelUndiPkg/XGigUndiDxe/Xgbe.c +++ b/IntelUndiPkg/XGigUndiDxe/Xgbe.c @@ -1264,7 +1264,7 @@ XgbeTxRxConfigure ( IXGBE_WRITE_REG (&XgbeAdapter->Hw, IXGBE_RDBAL (0), (UINT32) (UINTN) (XgbeAdapter->RxRing.PhysicalAddress)); MemAddr = (UINT64) (UINTN) XgbeAdapter->RxRing.PhysicalAddress; - MemPtr = &((UINT32) MemAddr); + MemPtr = (UINT32 *) &MemAddr; MemPtr++; IXGBE_WRITE_REG (&XgbeAdapter->Hw, IXGBE_RDBAH (0), *MemPtr); DEBUGPRINT (XGBE, ("Rdbal0 %X\n", (UINT32) IXGBE_READ_REG (&XgbeAdapter->Hw, IXGBE_RDBAL (0)))); @@ -1337,7 +1337,7 @@ XgbeTxRxConfigure ( XgbeAdapter->XmitDoneHead = 0; // the last cleaned buffer IXGBE_WRITE_REG (&XgbeAdapter->Hw, IXGBE_TDBAL (0), (UINT32) (XgbeAdapter->TxRing.PhysicalAddress)); MemAddr = (UINT64) XgbeAdapter->TxRing.PhysicalAddress; - MemPtr = &((UINT32) MemAddr); + MemPtr = (UINT32 *) &MemAddr; MemPtr++; IXGBE_WRITE_REG (&XgbeAdapter->Hw, IXGBE_TDBAH (0), *MemPtr); DEBUGPRINT (XGBE, ("TdBah0 %X\n", *MemPtr)); -- 2.17.1