From patchwork Thu Nov 15 02:33:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 151149 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6453837ljp; Wed, 14 Nov 2018 18:34:52 -0800 (PST) X-Google-Smtp-Source: AJdET5dZWfbggBc+a0Z/o4yzA9MhjQglXhLQw9KsUUyCgcItSJJwGZHw6egYa3cpI9i5VIXGEoX1 X-Received: by 2002:a02:2586:: with SMTP id g128-v6mr4188959jag.122.1542249292463; Wed, 14 Nov 2018 18:34:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542249292; cv=none; d=google.com; s=arc-20160816; b=Uy1/dLlSPWPh1whoE4BpeZN7rv5S2CiM8bU5lIwf6MVMPzhFfiVZh3JmMjJCandKNg WQonqUU4NuSK8I9un7Bj1+wG2WNtdH4wFA9ohOgLHj9uGIk68V1ctSwLKPPSTKcsiv5Y cDEHjKUOC0uy2xmJ3IP3PBYA7EO/lJDYbzyzO1EGTt0XjeDuDzvIsWmJ1jtHfOhq4x3p z6t3wIdQMom3x1kMzKBRvjJqw8oIgCbrESWcKgPxk8qeasz2QWd65hDMtVnMk9fh90Jg orqC6QTsvVwHmvZKhmmJMbVEbdN3Hkov6aQ9iMr4hhS0knU9Js5JaOzOJnLZRm0ASUXX Tfag== 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=RgMYdB0mi1o6faJ5COUPotkMFIi3bcCldEtlAIO0pFw=; b=w7Db+ul5LLfNdo93ZzjiZ7O8LIPGFht+WbfsrEw9ANl5qgr0iG84UvknWdMaHHgWVS keQFMhPYCL1anAVNPArWEyuYPRYQGW7S6/hGvaYmD7nb3wAOMMusI88xdJtNVcqPQIao IpLH8zenKrv3nAvRWXLYB4PSq/1og/lSDH2y/AhtbyWtO/165Ie/Erd/n8uoMOqEGgM0 uwHGdlE3Rb5z1w98qP3fPT5EwEtZPd5bZTVNm5wFAD/ovI0T4wFSCES2UIlZVU4lcPee Jmg+7LSNNNXfcH50HNCW3RB/L/s9atG8xAF8Q90OUNA7tOPwaJ/ZKlV5miNVteeM/IwS h+Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kLDjHoGH; 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 194-v6si11737577itl.0.2018.11.14.18.34.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Nov 2018 18:34:52 -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=kLDjHoGH; 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 3C7F02119172F; Wed, 14 Nov 2018 18:34:17 -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::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-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 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: [edk2] [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: , 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" 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(-) -- 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/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));