public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [edk2 Patch v2 0/1] compiler error due to arithmetic operation on void pointer
@ 2024-02-06 16:19 Jayaprakash, N
  2024-02-06 16:19 ` [edk2-devel] [edk2 Patch 2 1/1] EmbeddedPkg: " Jayaprakash, N
  0 siblings, 1 reply; 6+ messages in thread
From: Jayaprakash, N @ 2024-02-06 16:19 UTC (permalink / raw)
  To: devel; +Cc: Jayaprakash N

This patch fixes the compiler error generated while compiling the EmbeddedPkg
due to arithmetic operation being performed on a void pointer.

Jayaprakash N (1):
  EmbeddedPkg: compiler error due to arithmetic operation on void
    pointer

 .../Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115178): https://edk2.groups.io/g/devel/message/115178
Mute This Topic: https://groups.io/mt/104200839/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [edk2-devel] [edk2 Patch 2 1/1] EmbeddedPkg: compiler error due to arithmetic operation on void pointer
  2024-02-06 16:19 [edk2-devel] [edk2 Patch v2 0/1] compiler error due to arithmetic operation on void pointer Jayaprakash, N
@ 2024-02-06 16:19 ` Jayaprakash, N
  2024-02-07 20:00   ` Laszlo Ersek
  0 siblings, 1 reply; 6+ messages in thread
From: Jayaprakash, N @ 2024-02-06 16:19 UTC (permalink / raw)
  To: devel
  Cc: Jayaprakash N, Rebecca Cran, Michael D Kinney, Laszlo Ersek,
	Leif Lindholm, Ard Biesheuvel, Abner Chang

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 <rebecca@bsdio.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Jayaprakash N <n.jayaprakash@intel.com>
Signed-off-by: Jayaprakash N <n.jayaprakash@intel.com>
---
 .../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..f4077c04a7 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)OldBuffer + OldSize) <= HandOffHob->EfiFreeMemoryBottom));
   }
 
   DEBUG_CODE_END ();
-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115179): https://edk2.groups.io/g/devel/message/115179
Mute This Topic: https://groups.io/mt/104200842/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] [edk2 Patch 2 1/1] EmbeddedPkg: compiler error due to arithmetic operation on void pointer
  2024-02-06 16:19 ` [edk2-devel] [edk2 Patch 2 1/1] EmbeddedPkg: " Jayaprakash, N
@ 2024-02-07 20:00   ` Laszlo Ersek
  2024-02-09 11:56     ` Ard Biesheuvel
  0 siblings, 1 reply; 6+ messages in thread
From: Laszlo Ersek @ 2024-02-07 20:00 UTC (permalink / raw)
  To: Jayaprakash N, devel
  Cc: Rebecca Cran, Michael D Kinney, Leif Lindholm, Ard Biesheuvel,
	Abner Chang

On 2/6/24 17:19, 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 <rebecca@bsdio.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Leif Lindholm <quic_llindhol@quicinc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Abner Chang <abner.chang@amd.com>
> Cc: Jayaprakash N <n.jayaprakash@intel.com>
> Signed-off-by: Jayaprakash N <n.jayaprakash@intel.com>
> ---
>  .../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..f4077c04a7 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)OldBuffer + OldSize) <= HandOffHob->EfiFreeMemoryBottom));
>    }
>  
>    DEBUG_CODE_END ();

Reviewed-by: Laszlo Ersek <lersek@redhat.com>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115246): https://edk2.groups.io/g/devel/message/115246
Mute This Topic: https://groups.io/mt/104200842/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] [edk2 Patch 2 1/1] EmbeddedPkg: compiler error due to arithmetic operation on void pointer
  2024-02-07 20:00   ` Laszlo Ersek
@ 2024-02-09 11:56     ` Ard Biesheuvel
  2024-02-09 17:07       ` Michael D Kinney
  0 siblings, 1 reply; 6+ messages in thread
From: Ard Biesheuvel @ 2024-02-09 11:56 UTC (permalink / raw)
  To: Laszlo Ersek, Michael D Kinney, Liming Gao (Byosoft address)
  Cc: Jayaprakash N, devel, Rebecca Cran, Leif Lindholm, Abner Chang

(cc Liming)

On Wed, 7 Feb 2024 at 20:00, Laszlo Ersek <lersek@redhat.com> wrote:
>
> On 2/6/24 17:19, 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 <rebecca@bsdio.com>
> > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > Cc: Laszlo Ersek <lersek@redhat.com>
> > Cc: Leif Lindholm <quic_llindhol@quicinc.com>
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > Cc: Abner Chang <abner.chang@amd.com>
> > Cc: Jayaprakash N <n.jayaprakash@intel.com>
> > Signed-off-by: Jayaprakash N <n.jayaprakash@intel.com>
> > ---
> >  .../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..f4077c04a7 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)OldBuffer + OldSize) <= HandOffHob->EfiFreeMemoryBottom));
> >    }
> >
> >    DEBUG_CODE_END ();
>
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
>

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>

Liming, Michael - please apply this for the stable tag


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115302): https://edk2.groups.io/g/devel/message/115302
Mute This Topic: https://groups.io/mt/104200842/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] [edk2 Patch 2 1/1] EmbeddedPkg: compiler error due to arithmetic operation on void pointer
  2024-02-09 11:56     ` Ard Biesheuvel
@ 2024-02-09 17:07       ` Michael D Kinney
  2024-02-09 18:13         ` Michael D Kinney
  0 siblings, 1 reply; 6+ messages in thread
From: Michael D Kinney @ 2024-02-09 17:07 UTC (permalink / raw)
  To: Ard Biesheuvel, Laszlo Ersek, Liming Gao (Byosoft address)
  Cc: Jayaprakash, N, devel@edk2.groups.io, Rebecca Cran, Leif Lindholm,
	Abner Chang, Kinney, Michael D

Acked-by: Michael D Kinney <michael.d.kinney@intel.com>

Request to merge into edk2-stable202402 is approved.

PR opened: https://github.com/tianocore/edk2/pull/5363

Mike

> -----Original Message-----
> From: Ard Biesheuvel <ardb@kernel.org>
> Sent: Friday, February 9, 2024 3:57 AM
> To: Laszlo Ersek <lersek@redhat.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Liming Gao (Byosoft address)
> <gaoliming@byosoft.com.cn>
> Cc: Jayaprakash, N <n.jayaprakash@intel.com>; devel@edk2.groups.io;
> Rebecca Cran <rebecca@bsdio.com>; Leif Lindholm
> <quic_llindhol@quicinc.com>; Abner Chang <abner.chang@amd.com>
> Subject: Re: [edk2 Patch 2 1/1] EmbeddedPkg: compiler error due to
> arithmetic operation on void pointer
> 
> (cc Liming)
> 
> On Wed, 7 Feb 2024 at 20:00, Laszlo Ersek <lersek@redhat.com> wrote:
> >
> > On 2/6/24 17:19, 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 <rebecca@bsdio.com>
> > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > > Cc: Laszlo Ersek <lersek@redhat.com>
> > > Cc: Leif Lindholm <quic_llindhol@quicinc.com>
> > > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > > Cc: Abner Chang <abner.chang@amd.com>
> > > Cc: Jayaprakash N <n.jayaprakash@intel.com>
> > > Signed-off-by: Jayaprakash N <n.jayaprakash@intel.com>
> > > ---
> > >  .../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..f4077c04a7 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)OldBuffer + OldSize) <=
> HandOffHob->EfiFreeMemoryBottom));
> > >    }
> > >
> > >    DEBUG_CODE_END ();
> >
> > Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> >
> 
> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
> 
> Liming, Michael - please apply this for the stable tag


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115311): https://edk2.groups.io/g/devel/message/115311
Mute This Topic: https://groups.io/mt/104200842/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] [edk2 Patch 2 1/1] EmbeddedPkg: compiler error due to arithmetic operation on void pointer
  2024-02-09 17:07       ` Michael D Kinney
@ 2024-02-09 18:13         ` Michael D Kinney
  0 siblings, 0 replies; 6+ messages in thread
From: Michael D Kinney @ 2024-02-09 18:13 UTC (permalink / raw)
  To: Ard Biesheuvel, Laszlo Ersek, Liming Gao (Byosoft address)
  Cc: Jayaprakash, N, devel@edk2.groups.io, Rebecca Cran, Leif Lindholm,
	Abner Chang, Kinney, Michael D

Merged: https://github.com/tianocore/edk2/pull/5363


> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Friday, February 9, 2024 9:08 AM
> To: Ard Biesheuvel <ardb@kernel.org>; Laszlo Ersek <lersek@redhat.com>;
> Liming Gao (Byosoft address) <gaoliming@byosoft.com.cn>
> Cc: Jayaprakash, N <n.jayaprakash@intel.com>; devel@edk2.groups.io;
> Rebecca Cran <rebecca@bsdio.com>; Leif Lindholm
> <quic_llindhol@quicinc.com>; Abner Chang <abner.chang@amd.com>; Kinney,
> Michael D <michael.d.kinney@intel.com>
> Subject: RE: [edk2 Patch 2 1/1] EmbeddedPkg: compiler error due to
> arithmetic operation on void pointer
> 
> Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
> 
> Request to merge into edk2-stable202402 is approved.
> 
> PR opened: https://github.com/tianocore/edk2/pull/5363
> 
> Mike
> 
> > -----Original Message-----
> > From: Ard Biesheuvel <ardb@kernel.org>
> > Sent: Friday, February 9, 2024 3:57 AM
> > To: Laszlo Ersek <lersek@redhat.com>; Kinney, Michael D
> > <michael.d.kinney@intel.com>; Liming Gao (Byosoft address)
> > <gaoliming@byosoft.com.cn>
> > Cc: Jayaprakash, N <n.jayaprakash@intel.com>; devel@edk2.groups.io;
> > Rebecca Cran <rebecca@bsdio.com>; Leif Lindholm
> > <quic_llindhol@quicinc.com>; Abner Chang <abner.chang@amd.com>
> > Subject: Re: [edk2 Patch 2 1/1] EmbeddedPkg: compiler error due to
> > arithmetic operation on void pointer
> >
> > (cc Liming)
> >
> > On Wed, 7 Feb 2024 at 20:00, Laszlo Ersek <lersek@redhat.com> wrote:
> > >
> > > On 2/6/24 17:19, 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 <rebecca@bsdio.com>
> > > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > > > Cc: Laszlo Ersek <lersek@redhat.com>
> > > > Cc: Leif Lindholm <quic_llindhol@quicinc.com>
> > > > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > > > Cc: Abner Chang <abner.chang@amd.com>
> > > > Cc: Jayaprakash N <n.jayaprakash@intel.com>
> > > > Signed-off-by: Jayaprakash N <n.jayaprakash@intel.com>
> > > > ---
> > > >  .../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..f4077c04a7 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)OldBuffer + OldSize)
> <=
> > HandOffHob->EfiFreeMemoryBottom));
> > > >    }
> > > >
> > > >    DEBUG_CODE_END ();
> > >
> > > Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> > >
> >
> > Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
> >
> > Liming, Michael - please apply this for the stable tag


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115314): https://edk2.groups.io/g/devel/message/115314
Mute This Topic: https://groups.io/mt/104200842/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-02-09 18:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-06 16:19 [edk2-devel] [edk2 Patch v2 0/1] compiler error due to arithmetic operation on void pointer Jayaprakash, N
2024-02-06 16:19 ` [edk2-devel] [edk2 Patch 2 1/1] EmbeddedPkg: " Jayaprakash, N
2024-02-07 20:00   ` Laszlo Ersek
2024-02-09 11:56     ` Ard Biesheuvel
2024-02-09 17:07       ` Michael D Kinney
2024-02-09 18:13         ` Michael D Kinney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox