From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 01CFC78003C for ; Tue, 6 Feb 2024 12:57:58 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=8IhLyOYCqRysJ35f1gZunYNM0yclrgj24Z8qxlK1tv0=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20140610; t=1707224277; v=1; b=COg89CAj1xl88wQGLqxSIfwGcJVre1/VZ6g5aZpZAElD565AjdWWPGP59d/rdSHRi7j6bCJB OXc0OHPJMFXxjxZ3fcCg/F3Rb2MQsLnRRFGop3h55GP7Gqd3gXAJotUJpwZ5tWQsPoHvUjBoGDc +D/BK26B8BUCizkWnr7wUnU8= X-Received: by 127.0.0.2 with SMTP id hdiZYY7687511xyue5207kxw; Tue, 06 Feb 2024 04:57:57 -0800 X-Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by mx.groups.io with SMTP id smtpd.web11.20715.1707224276695674266 for ; Tue, 06 Feb 2024 04:57:57 -0800 X-Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 987ABCE1353 for ; Tue, 6 Feb 2024 12:57:53 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C8D8C433B2 for ; Tue, 6 Feb 2024 12:57:53 +0000 (UTC) X-Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-5114b1e8819so3464209e87.1 for ; Tue, 06 Feb 2024 04:57:53 -0800 (PST) X-Gm-Message-State: mnIC2DuLedQtaiLoOx5NMTV7x7686176AA= X-Google-Smtp-Source: AGHT+IE/gWwkvdy7B3MxmAr3Yh2QHGjE+kbJ1q5rHNSNBZ7yCw+yq7jkchthpAVExIuKGAjcuY6br0QhA5h/Xq2DkeM= X-Received: by 2002:a05:6512:311c:b0:511:19bf:fa0c with SMTP id n28-20020a056512311c00b0051119bffa0cmr1809710lfb.56.1707224271229; Tue, 06 Feb 2024 04:57:51 -0800 (PST) MIME-Version: 1.0 References: <20240206052320.1233-1-n.jayaprakash@intel.com> <20240206052320.1233-2-n.jayaprakash@intel.com> In-Reply-To: <20240206052320.1233-2-n.jayaprakash@intel.com> From: "Ard Biesheuvel" Date: Tue, 6 Feb 2024 12:57:40 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [edk2 Patch 1/1] EmbeddedPkg: compiler error due to arithmetic operation on void pointer To: devel@edk2.groups.io, n.jayaprakash@intel.com Cc: Rebecca Cran , Michael D Kinney , Laszlo Ersek , Leif Lindholm , Ard Biesheuvel , Abner Chang Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ardb@kernel.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=COg89CAj; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On Tue, 6 Feb 2024 at 05:23, Jayaprakash, N wrote: > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4668 > > This commit fixes the issue reported in the BZ4668. > The EmbeddedPkg fails to compile with a compiler error > generated due to invalid/illegal arithmetic operation > on void pointers. It has been fixed by using explicit > type conversion of the void pointer to UINTN. > > Cc: Rebecca Cran > Cc: Michael D Kinney > Cc: Laszlo Ersek > Cc: Leif Lindholm > Cc: Ard Biesheuvel > Cc: Abner Chang > Cc: Jayaprakash N > Signed-off-by: Jayaprakash N > --- > .../Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c b/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c > index fa81cc9d59..11566cf57f 100644 > --- a/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c > +++ b/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c > @@ -308,7 +308,7 @@ ReallocatePool ( > if (OldBuffer != NULL) { > HandOffHob = GetHobList (); > ASSERT (((EFI_PHYSICAL_ADDRESS)(UINTN)OldBuffer >= HandOffHob->EfiMemoryBottom)); > - ASSERT (((EFI_PHYSICAL_ADDRESS)(UINTN)(OldBuffer + OldSize) <= HandOffHob->EfiFreeMemoryBottom)); > + ASSERT (((EFI_PHYSICAL_ADDRESS)(UINTN)((UINTN)OldBuffer + OldSize) <= HandOffHob->EfiFreeMemoryBottom)); Do we really need two UINTN casts here? -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115158): https://edk2.groups.io/g/devel/message/115158 Mute This Topic: https://groups.io/mt/104193285/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-