Discussion:
[edk2] [PATCH] MdeModulePkg/DxeCore: Fixed build error
Olivier Martin
2015-05-27 15:32:52 UTC
Permalink
ARM toolchain raises the build error: "enumerated
type mixed with another type"

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <***@arm.com>
---
MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
index 2c6713f..b23a056 100644
--- a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
+++ b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
@@ -789,7 +789,7 @@ GetProfileMemoryIndex (
if ((UINT32) MemoryType >= MEMORY_TYPE_OS_RESERVED_MIN) {
return EfiMaxMemoryType;
} else if ((UINT32) MemoryType >= MEMORY_TYPE_OEM_RESERVED_MIN) {
- return EfiMaxMemoryType + 1;
+ return (EFI_MEMORY_TYPE)(EfiMaxMemoryType + 1);
} else {
return MemoryType;
}
--
2.1.1


------------------------------------------------------------------------------
Jordan Justen
2015-05-27 18:32:39 UTC
Permalink
Post by Olivier Martin
ARM toolchain raises the build error: "enumerated
type mixed with another type"
Contributed-under: TianoCore Contribution Agreement 1.0
---
MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
index 2c6713f..b23a056 100644
--- a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
+++ b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
@@ -789,7 +789,7 @@ GetProfileMemoryIndex (
if ((UINT32) MemoryType >= MEMORY_TYPE_OS_RESERVED_MIN) {
return EfiMaxMemoryType;
} else if ((UINT32) MemoryType >= MEMORY_TYPE_OEM_RESERVED_MIN) {
- return EfiMaxMemoryType + 1;
+ return (EFI_MEMORY_TYPE)(EfiMaxMemoryType + 1);
The code style would want a space after the cast close parens, right?
Post by Olivier Martin
} else {
return MemoryType;
}
--
2.1.1
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Laszlo Ersek
2015-05-27 18:58:32 UTC
Permalink
Post by Jordan Justen
Post by Olivier Martin
ARM toolchain raises the build error: "enumerated
type mixed with another type"
Contributed-under: TianoCore Contribution Agreement 1.0
---
MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
index 2c6713f..b23a056 100644
--- a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
+++ b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
@@ -789,7 +789,7 @@ GetProfileMemoryIndex (
if ((UINT32) MemoryType >= MEMORY_TYPE_OS_RESERVED_MIN) {
return EfiMaxMemoryType;
} else if ((UINT32) MemoryType >= MEMORY_TYPE_OEM_RESERVED_MIN) {
- return EfiMaxMemoryType + 1;
+ return (EFI_MEMORY_TYPE)(EfiMaxMemoryType + 1);
The code style would want a space after the cast close parens, right?
(It would, and it is so wrong! Obligatory reference:
<https://github.com/tianocore/edk2/commit/71914406>. This is the one and
only bit in the code style that is entirely harmful.)

Laszlo
Post by Jordan Justen
Post by Olivier Martin
} else {
return MemoryType;
}
--
2.1.1
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Zeng, Star
2015-05-28 01:20:07 UTC
Permalink
To eliminate the confusion, how about to update the return type of GetProfileMemoryIndex() from EFI_MEMORY_TYPE to UINT32 or UINTN?

Thanks,
Star
-----Original Message-----
From: Laszlo Ersek [mailto:***@redhat.com]
Sent: Thursday, May 28, 2015 2:59 AM
To: Justen, Jordan L
Cc: edk2-***@lists.sourceforge.net
Subject: Re: [edk2] [PATCH] MdeModulePkg/DxeCore: Fixed build error
Post by Jordan Justen
ARM toolchain raises the build error: "enumerated type mixed with
another type"
Contributed-under: TianoCore Contribution Agreement 1.0
---
MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
index 2c6713f..b23a056 100644
--- a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
+++ b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
@@ -789,7 +789,7 @@ GetProfileMemoryIndex (
if ((UINT32) MemoryType >= MEMORY_TYPE_OS_RESERVED_MIN) {
return EfiMaxMemoryType;
} else if ((UINT32) MemoryType >= MEMORY_TYPE_OEM_RESERVED_MIN) {
- return EfiMaxMemoryType + 1;
+ return (EFI_MEMORY_TYPE)(EfiMaxMemoryType + 1);
The code style would want a space after the cast close parens, right?
(It would, and it is so wrong! Obligatory reference:
<https://github.com/tianocore/edk2/commit/71914406>. This is the one and only bit in the code style that is entirely harmful.)

Laszlo
Post by Jordan Justen
} else {
return MemoryType;
}
--
2.1.1
---------------------------------------------------------------------
--------- _______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
----------------------------------------------------------------------
-------- _______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
Olivier Martin
2015-05-28 09:39:52 UTC
Permalink
Yes, that would be another valid solution. Star, do you want to make the patch?

-----Original Message-----
From: Zeng, Star [mailto:***@intel.com]
Sent: 28 May 2015 02:20
To: edk2-***@lists.sourceforge.net; Justen, Jordan L
Subject: Re: [edk2] [PATCH] MdeModulePkg/DxeCore: Fixed build error

To eliminate the confusion, how about to update the return type of GetProfileMemoryIndex() from EFI_MEMORY_TYPE to UINT32 or UINTN?

Thanks,
Star
-----Original Message-----
From: Laszlo Ersek [mailto:***@redhat.com]
Sent: Thursday, May 28, 2015 2:59 AM
To: Justen, Jordan L
Cc: edk2-***@lists.sourceforge.net
Subject: Re: [edk2] [PATCH] MdeModulePkg/DxeCore: Fixed build error
Post by Jordan Justen
ARM toolchain raises the build error: "enumerated type mixed with
another type"
Contributed-under: TianoCore Contribution Agreement 1.0
---
MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
index 2c6713f..b23a056 100644
--- a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
+++ b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
@@ -789,7 +789,7 @@ GetProfileMemoryIndex (
if ((UINT32) MemoryType >= MEMORY_TYPE_OS_RESERVED_MIN) {
return EfiMaxMemoryType;
} else if ((UINT32) MemoryType >= MEMORY_TYPE_OEM_RESERVED_MIN) {
- return EfiMaxMemoryType + 1;
+ return (EFI_MEMORY_TYPE)(EfiMaxMemoryType + 1);
The code style would want a space after the cast close parens, right?
(It would, and it is so wrong! Obligatory reference:
<https://github.com/tianocore/edk2/commit/71914406>. This is the one and only bit in the code style that is entirely harmful.)

Laszlo
Post by Jordan Justen
} else {
return MemoryType;
}
--
2.1.1
---------------------------------------------------------------------
--------- _______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
----------------------------------------------------------------------
-------- _______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782


------------------------------------------------------------------------------
Zeng, Star
2015-05-28 10:26:13 UTC
Permalink
Olivier,

Thanks, see the attached patch.

Star
-----Original Message-----
From: Olivier Martin [mailto:***@arm.com]
Sent: Thursday, May 28, 2015 5:40 PM
To: edk2-***@lists.sourceforge.net; Justen, Jordan L
Subject: Re: [edk2] [PATCH] MdeModulePkg/DxeCore: Fixed build error

Yes, that would be another valid solution. Star, do you want to make the patch?

-----Original Message-----
From: Zeng, Star [mailto:***@intel.com]
Sent: 28 May 2015 02:20
To: edk2-***@lists.sourceforge.net; Justen, Jordan L
Subject: Re: [edk2] [PATCH] MdeModulePkg/DxeCore: Fixed build error

To eliminate the confusion, how about to update the return type of GetProfileMemoryIndex() from EFI_MEMORY_TYPE to UINT32 or UINTN?

Thanks,
Star
-----Original Message-----
From: Laszlo Ersek [mailto:***@redhat.com]
Sent: Thursday, May 28, 2015 2:59 AM
To: Justen, Jordan L
Cc: edk2-***@lists.sourceforge.net
Subject: Re: [edk2] [PATCH] MdeModulePkg/DxeCore: Fixed build error
Post by Jordan Justen
ARM toolchain raises the build error: "enumerated type mixed with
another type"
Contributed-under: TianoCore Contribution Agreement 1.0
---
MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
index 2c6713f..b23a056 100644
--- a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
+++ b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
@@ -789,7 +789,7 @@ GetProfileMemoryIndex (
if ((UINT32) MemoryType >= MEMORY_TYPE_OS_RESERVED_MIN) {
return EfiMaxMemoryType;
} else if ((UINT32) MemoryType >= MEMORY_TYPE_OEM_RESERVED_MIN) {
- return EfiMaxMemoryType + 1;
+ return (EFI_MEMORY_TYPE)(EfiMaxMemoryType + 1);
The code style would want a space after the cast close parens, right?
(It would, and it is so wrong! Obligatory reference:
<https://github.com/tianocore/edk2/commit/71914406>. This is the one and only bit in the code style that is entirely harmful.)

Laszlo
Post by Jordan Justen
} else {
return MemoryType;
}
--
2.1.1
---------------------------------------------------------------------
--------- _______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
----------------------------------------------------------------------
-------- _______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590 ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782


------------------------------------------------------------------------------
Jordan Justen
2015-05-28 15:00:57 UTC
Permalink
Post by Zeng, Star
Olivier,
Thanks, see the attached patch.
Star
-----Original Message-----
Sent: Thursday, May 28, 2015 5:40 PM
Subject: Re: [edk2] [PATCH] MdeModulePkg/DxeCore: Fixed build error
Yes, that would be another valid solution. Star, do you want to make the patch?
-----Original Message-----
Sent: 28 May 2015 02:20
Subject: Re: [edk2] [PATCH] MdeModulePkg/DxeCore: Fixed build error
To eliminate the confusion, how about to update the return type of GetProfileMemoryIndex() from EFI_MEMORY_TYPE to UINT32 or UINTN?
Thanks,
Star
-----Original Message-----
Sent: Thursday, May 28, 2015 2:59 AM
To: Justen, Jordan L
Subject: Re: [edk2] [PATCH] MdeModulePkg/DxeCore: Fixed build error
Post by Jordan Justen
ARM toolchain raises the build error: "enumerated type mixed with
another type"
Contributed-under: TianoCore Contribution Agreement 1.0
---
MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
index 2c6713f..b23a056 100644
--- a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
+++ b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
@@ -789,7 +789,7 @@ GetProfileMemoryIndex (
if ((UINT32) MemoryType >= MEMORY_TYPE_OS_RESERVED_MIN) {
return EfiMaxMemoryType;
} else if ((UINT32) MemoryType >= MEMORY_TYPE_OEM_RESERVED_MIN) {
- return EfiMaxMemoryType + 1;
+ return (EFI_MEMORY_TYPE)(EfiMaxMemoryType + 1);
The code style would want a space after the cast close parens, right?
<https://github.com/tianocore/edk2/commit/71914406>. This is the one and only bit in the code style that is entirely harmful.)
Laszlo
Post by Jordan Justen
} else {
return MemoryType;
}
--
2.1.1
---------------------------------------------------------------------
--------- _______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
----------------------------------------------------------------------
-------- _______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590 ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Tian, Feng
2015-05-29 01:45:10 UTC
Permalink
Good to me as well.

Reviewed-by: Feng Tian <***@intel.com>

-----Original Message-----
From: Jordan Justen [mailto:***@intel.com]
Sent: Thursday, May 28, 2015 23:01
To: Zeng, Star; edk2-***@lists.sourceforge.net
Subject: Re: [edk2] [PATCH] MdeModulePkg/DxeCore: Fixed build error
Post by Zeng, Star
Olivier,
Thanks, see the attached patch.
Star
-----Original Message-----
Sent: Thursday, May 28, 2015 5:40 PM
Subject: Re: [edk2] [PATCH] MdeModulePkg/DxeCore: Fixed build error
Yes, that would be another valid solution. Star, do you want to make the patch?
-----Original Message-----
Sent: 28 May 2015 02:20
Subject: Re: [edk2] [PATCH] MdeModulePkg/DxeCore: Fixed build error
To eliminate the confusion, how about to update the return type of GetProfileMemoryIndex() from EFI_MEMORY_TYPE to UINT32 or UINTN?
Thanks,
Star
-----Original Message-----
Sent: Thursday, May 28, 2015 2:59 AM
To: Justen, Jordan L
Subject: Re: [edk2] [PATCH] MdeModulePkg/DxeCore: Fixed build error
Post by Jordan Justen
ARM toolchain raises the build error: "enumerated type mixed with
another type"
Contributed-under: TianoCore Contribution Agreement 1.0
---
MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
index 2c6713f..b23a056 100644
--- a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
+++ b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
@@ -789,7 +789,7 @@ GetProfileMemoryIndex (
if ((UINT32) MemoryType >= MEMORY_TYPE_OS_RESERVED_MIN) {
return EfiMaxMemoryType;
} else if ((UINT32) MemoryType >= MEMORY_TYPE_OEM_RESERVED_MIN) {
- return EfiMaxMemoryType + 1;
+ return (EFI_MEMORY_TYPE)(EfiMaxMemoryType + 1);
The code style would want a space after the cast close parens, right?
<https://github.com/tianocore/edk2/commit/71914406>. This is the one
and only bit in the code style that is entirely harmful.)
Laszlo
Post by Jordan Justen
} else {
return MemoryType;
}
--
2.1.1
-------------------------------------------------------------------
--
--------- _______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
--------------------------------------------------------------------
--
-------- _______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
----------------------------------------------------------------------
-------- _______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
----------------------------------------------------------------------
-------- _______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ,
Registered in England & Wales, Company No: 2557590 ARM Holdings plc,
Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in
England & Wales, Company No: 2548782
----------------------------------------------------------------------
-------- _______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
Loading...