From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.85.128.67; helo=mail-wm1-f67.google.com; envelope-from=philmd@redhat.com; receiver=edk2-devel@lists.01.org Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) (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 A211721189FB1 for ; Tue, 6 Nov 2018 12:36:25 -0800 (PST) Received: by mail-wm1-f67.google.com with SMTP id r63-v6so12183480wma.4 for ; Tue, 06 Nov 2018 12:36:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=qnGof89t/N6bQndcR2iCQkbsZkg4n6CWRSEgEjDjsgk=; b=jZfIvIDJPqygd1i0d3sae1vyEZSuMVxIvL9oe1wL3Vtyeq+T+4zyXvODBDpqTQwwyO LStQwtpeYd5QvXCcgHu1DQ7ric3cOrasPBg3SnmUrVwnOzoiTRr4EnndPQr623QD06jz M25iheCozY0juoMqTDYaFO+6XdmwkL6i61gjqsJsyRE7H5OnZ71cqvNtEFTHdMz3ArHk ul5sGNJOe1Zcv6s90haH4VcFXUMO5gX0KKQSp3S6a+tX2EWXmQEQmBMakVD0wLkB9wK0 +iJpAgvH3DSpCURqAlbwpBf+/RqYKt6ANwQxGNOMpjHG3/bRaA/gb3qg+IvBQ019h8mx svfA== X-Gm-Message-State: AGRZ1gIq4gS2uyVHe5rEh35o+mj0pbTfGCv8c3S4thDh117k8eSLjwod JLumLlAOMWSII0k9gK/3gDh7ug4eHwI= X-Google-Smtp-Source: AJdET5fenmOAY077l0i9AyGvCledXztFUri4ta4ykahqpPJAfjosr1Gj7Wvs1r3ABnxbm+V/DK4qJA== X-Received: by 2002:a1c:545e:: with SMTP id p30-v6mr3130461wmi.69.1541536584216; Tue, 06 Nov 2018 12:36:24 -0800 (PST) Received: from [192.168.1.74] (67.23.27.109.rev.sfr.net. [109.27.23.67]) by smtp.gmail.com with ESMTPSA id z6-v6sm27483287wrs.19.2018.11.06.12.36.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Nov 2018 12:36:23 -0800 (PST) To: Ard Biesheuvel , edk2-devel@lists.01.org Cc: michael.d.kinney@intel.com, eric.jin@intel.com References: <20181106175833.26964-1-ard.biesheuvel@linaro.org> <20181106175833.26964-14-ard.biesheuvel@linaro.org> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: <6e6e9c8e-675f-9626-7807-370cfd78a578@redhat.com> Date: Tue, 6 Nov 2018 21:36:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181106175833.26964-14-ard.biesheuvel@linaro.org> Subject: Re: [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 20:36:26 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit On 6/11/18 18:58, Ard Biesheuvel wrote: > 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 Reviewed-by: Philippe Mathieu-Daudé > --- > 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)); >