public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: Remove the redundant code
@ 2018-05-09 12:31 Yonghong Zhu
  2018-05-09 14:45 ` Carsey, Jaben
  0 siblings, 1 reply; 2+ messages in thread
From: Yonghong Zhu @ 2018-05-09 12:31 UTC (permalink / raw)
  To: edk2-devel

the ArraySize and Array already be got in line 1093, so this code are
redundant.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
 BaseTools/Source/Python/AutoGen/GenC.py | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Python/AutoGen/GenC.py
index 6192e86..40a343c 100644
--- a/BaseTools/Source/Python/AutoGen/GenC.py
+++ b/BaseTools/Source/Python/AutoGen/GenC.py
@@ -1096,20 +1096,10 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd):
         # Long term we need PCD macros that work in assembly
         #
         elif Pcd.Type != TAB_PCDS_FIXED_AT_BUILD and Pcd.DatumType in TAB_PCD_NUMERIC_TYPES_VOID:
             Value = "((%s)%s)" % (Pcd.DatumType, Value)
 
-        if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES_VOID:
-            # handle structure PCD
-            if Pcd.MaxDatumSize is None or Pcd.MaxDatumSize == '':
-                EdkLogger.error("build", AUTOGEN_ERROR,
-                                "Unknown [MaxDatumSize] of PCD [%s.%s]" % (Pcd.TokenSpaceGuidCName, TokenCName),
-                                ExtraData="[%s]" % str(Info))
-
-            ArraySize = int(Pcd.MaxDatumSize, 0)
-            Array = '[%d]' % ArraySize
-
         if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE:
             PcdValueName = '_PCD_PATCHABLE_VALUE_' + TokenCName
         else:
             PcdValueName = '_PCD_VALUE_' + TokenCName
             
-- 
2.6.1.windows.1



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

* Re: [Patch] BaseTools: Remove the redundant code
  2018-05-09 12:31 [Patch] BaseTools: Remove the redundant code Yonghong Zhu
@ 2018-05-09 14:45 ` Carsey, Jaben
  0 siblings, 0 replies; 2+ messages in thread
From: Carsey, Jaben @ 2018-05-09 14:45 UTC (permalink / raw)
  To: Zhu, Yonghong, edk2-devel@lists.01.org

Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

Gotta love removing code.

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Yonghong Zhu
> Sent: Wednesday, May 9, 2018 5:32 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [Patch] BaseTools: Remove the redundant code
> 
> the ArraySize and Array already be got in line 1093, so this code are
> redundant.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
> ---
>  BaseTools/Source/Python/AutoGen/GenC.py | 10 ----------
>  1 file changed, 10 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/GenC.py
> b/BaseTools/Source/Python/AutoGen/GenC.py
> index 6192e86..40a343c 100644
> --- a/BaseTools/Source/Python/AutoGen/GenC.py
> +++ b/BaseTools/Source/Python/AutoGen/GenC.py
> @@ -1096,20 +1096,10 @@ def CreateModulePcdCode(Info, AutoGenC,
> AutoGenH, Pcd):
>          # Long term we need PCD macros that work in assembly
>          #
>          elif Pcd.Type != TAB_PCDS_FIXED_AT_BUILD and Pcd.DatumType in
> TAB_PCD_NUMERIC_TYPES_VOID:
>              Value = "((%s)%s)" % (Pcd.DatumType, Value)
> 
> -        if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES_VOID:
> -            # handle structure PCD
> -            if Pcd.MaxDatumSize is None or Pcd.MaxDatumSize == '':
> -                EdkLogger.error("build", AUTOGEN_ERROR,
> -                                "Unknown [MaxDatumSize] of PCD [%s.%s]" %
> (Pcd.TokenSpaceGuidCName, TokenCName),
> -                                ExtraData="[%s]" % str(Info))
> -
> -            ArraySize = int(Pcd.MaxDatumSize, 0)
> -            Array = '[%d]' % ArraySize
> -
>          if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE:
>              PcdValueName = '_PCD_PATCHABLE_VALUE_' + TokenCName
>          else:
>              PcdValueName = '_PCD_VALUE_' + TokenCName
> 
> --
> 2.6.1.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


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

end of thread, other threads:[~2018-05-09 14:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-09 12:31 [Patch] BaseTools: Remove the redundant code Yonghong Zhu
2018-05-09 14:45 ` Carsey, Jaben

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