Discussion:
[edk2] [PATCH 0/2] MdePkg|MdeModulePkg: constify mStatusString
Ard Biesheuvel
2015-07-13 19:49:09 UTC
Permalink
This constifies two instances of mStatusString, preventing it from
being emitted into the .data section.

Ard Biesheuvel (2):
MdePkg/BasePrintLib: make mStatusString array CONST
MdeModulePkg/DxePrintLibPrint2Protocol: make mStatusString array CONST

MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c | 2 +-
MdePkg/Library/BasePrintLib/PrintLibInternal.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--
1.9.1
Ard Biesheuvel
2015-07-13 19:49:10 UTC
Permalink
Change the type of mStatusString[] to reflect that it is a CONST
array of pointers to CONST.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <***@linaro.org>
---
MdePkg/Library/BasePrintLib/PrintLibInternal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdePkg/Library/BasePrintLib/PrintLibInternal.c b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
index a114bde13a9b..d73e1d65c4ea 100644
--- a/MdePkg/Library/BasePrintLib/PrintLibInternal.c
+++ b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
@@ -19,7 +19,7 @@

GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 mHexStr[] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};

-GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 *mStatusString[] = {
+GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 * CONST mStatusString[] = {
"Success", // RETURN_SUCCESS = 0
"Warning Unknown Glyph", // RETURN_WARN_UNKNOWN_GLYPH = 1
"Warning Delete Failure", // RETURN_WARN_DELETE_FAILURE = 2
--
1.9.1
Carsey, Jaben
2015-07-13 21:14:04 UTC
Permalink
-----Original Message-----
Sent: Monday, July 13, 2015 12:49 PM
To: Kinney, Michael D; Gao, Liming; Tian, Feng; edk2-
Subject: [edk2] [PATCH 1/2] MdePkg/BasePrintLib: make mStatusString array
CONST
Change the type of mStatusString[] to reflect that it is a CONST
array of pointers to CONST.
Contributed-under: TianoCore Contribution Agreement 1.0
---
MdePkg/Library/BasePrintLib/PrintLibInternal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MdePkg/Library/BasePrintLib/PrintLibInternal.c
b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
index a114bde13a9b..d73e1d65c4ea 100644
--- a/MdePkg/Library/BasePrintLib/PrintLibInternal.c
+++ b/MdePkg/Library/BasePrintLib/PrintLibInternal.c
@@ -19,7 +19,7 @@
GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 mHexStr[] =
{'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
-GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 *mStatusString[] = {
+GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 * CONST
mStatusString[] = {
"Success", // RETURN_SUCCESS = 0
"Warning Unknown Glyph", // RETURN_WARN_UNKNOWN_GLYPH = 1
"Warning Delete Failure", // RETURN_WARN_DELETE_FAILURE = 2
--
1.9.1
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
Ard Biesheuvel
2015-07-13 19:49:11 UTC
Permalink
Change the type of mStatusString[] to reflect that it is a CONST
array of pointers to CONST.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <***@linaro.org>
---
MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c b/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c
index a41f228cc2c3..4acdcb871490 100644
--- a/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c
+++ b/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c
@@ -1081,7 +1081,7 @@ InternalPrintLibSPrint (
#define WARNING_STATUS_NUMBER 5
#define ERROR_STATUS_NUMBER 33

-GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 *mStatusString[] = {
+GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 * CONST mStatusString[] = {
"Success", // RETURN_SUCCESS = 0
"Warning Unknown Glyph", // RETURN_WARN_UNKNOWN_GLYPH = 1
"Warning Delete Failure", // RETURN_WARN_DELETE_FAILURE = 2
--
1.9.1
Carsey, Jaben
2015-07-13 21:13:23 UTC
Permalink
-----Original Message-----
Sent: Monday, July 13, 2015 12:49 PM
To: Kinney, Michael D; Gao, Liming; Tian, Feng; edk2-
make mStatusString array CONST
Change the type of mStatusString[] to reflect that it is a CONST
array of pointers to CONST.
Contributed-under: TianoCore Contribution Agreement 1.0
---
MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c
b/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c
index a41f228cc2c3..4acdcb871490 100644
--- a/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c
+++ b/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c
@@ -1081,7 +1081,7 @@ InternalPrintLibSPrint (
#define WARNING_STATUS_NUMBER 5
#define ERROR_STATUS_NUMBER 33
-GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 *mStatusString[] = {
+GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 * CONST
mStatusString[] = {
"Success", // RETURN_SUCCESS = 0
"Warning Unknown Glyph", // RETURN_WARN_UNKNOWN_GLYPH = 1
"Warning Delete Failure", // RETURN_WARN_DELETE_FAILURE = 2
--
1.9.1
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
Laszlo Ersek
2015-07-13 19:58:55 UTC
Permalink
Post by Ard Biesheuvel
This constifies two instances of mStatusString, preventing it from
being emitted into the .data section.
MdePkg/BasePrintLib: make mStatusString array CONST
MdeModulePkg/DxePrintLibPrint2Protocol: make mStatusString array CONST
MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c | 2 +-
MdePkg/Library/BasePrintLib/PrintLibInternal.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Laszlo Ersek <***@redhat.com>
Ard Biesheuvel
2015-07-15 11:20:39 UTC
Permalink
Post by Ard Biesheuvel
This constifies two instances of mStatusString, preventing it from
being emitted into the .data section.
MdePkg/BasePrintLib: make mStatusString array CONST
MdeModulePkg/DxePrintLibPrint2Protocol: make mStatusString array CONST
MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c | 2 +-
MdePkg/Library/BasePrintLib/PrintLibInternal.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
I have cc'ed the maintainers of MdePkg and MdeModulePkg on these
patches, and so far I have received R-b's from Laszlo and Jaben.

@Liming, Feng: are you ok with these?
--
Ard.
Gao, Liming
2015-07-16 00:32:56 UTC
Permalink
Reviewed-by: Liming Gao <***@intel.com>

-----Original Message-----
From: Ard Biesheuvel [mailto:***@linaro.org]
Sent: Tuesday, July 14, 2015 3:49 AM
To: Kinney, Michael D; Gao, Liming; Tian, Feng; edk2-***@lists.sourceforge.net
Cc: Ard Biesheuvel
Subject: [PATCH 0/2] MdePkg|MdeModulePkg: constify mStatusString

This constifies two instances of mStatusString, preventing it from being emitted into the .data section.

Ard Biesheuvel (2):
MdePkg/BasePrintLib: make mStatusString array CONST
MdeModulePkg/DxePrintLibPrint2Protocol: make mStatusString array CONST

MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c | 2 +-
MdePkg/Library/BasePrintLib/PrintLibInternal.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

--
1.9.1
Tian, Feng
2015-07-16 01:47:40 UTC
Permalink
Reviewed-by: Feng Tian <***@intel.com>

-----Original Message-----
From: Gao, Liming
Sent: Thursday, July 16, 2015 08:33
To: Ard Biesheuvel; Kinney, Michael D; Tian, Feng; edk2-***@lists.sourceforge.net
Subject: RE: [PATCH 0/2] MdePkg|MdeModulePkg: constify mStatusString

Reviewed-by: Liming Gao <***@intel.com>

-----Original Message-----
From: Ard Biesheuvel [mailto:***@linaro.org]
Sent: Tuesday, July 14, 2015 3:49 AM
To: Kinney, Michael D; Gao, Liming; Tian, Feng; edk2-***@lists.sourceforge.net
Cc: Ard Biesheuvel
Subject: [PATCH 0/2] MdePkg|MdeModulePkg: constify mStatusString

This constifies two instances of mStatusString, preventing it from being emitted into the .data section.

Ard Biesheuvel (2):
MdePkg/BasePrintLib: make mStatusString array CONST
MdeModulePkg/DxePrintLibPrint2Protocol: make mStatusString array CONST

MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c | 2 +-
MdePkg/Library/BasePrintLib/PrintLibInternal.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

--
1.9.1

Loading...