public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: Allow empty value for HiiPcd in Dsc
@ 2019-01-16 16:21 Feng, Bob C
  2019-01-17 14:09 ` Gao, Liming
  0 siblings, 1 reply; 2+ messages in thread
From: Feng, Bob C @ 2019-01-16 16:21 UTC (permalink / raw)
  To: edk2-devel; +Cc: Bob Feng, Liming Gao, Jaben Carsey

https://bugzilla.tianocore.org/show_bug.cgi?id=1466

DEC file defines PCD default value and PCD supported type.
DSC can configure PCD type and value.
If the value is same to default value in DEC file,
DSC can only configure PCD type and leave empty for value.
This usage supports all type PCD except for DynamicHii type.
So, DynamicHii PCD should support this usage. Below is one example in DSC.

for example,
[PcdsDynamicHii.common.DEFAULT]
PcdPkgTokenSpaceGuid.PcdCName|L"VarName"|gVarGuid|0x00||NV,BS

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
---
 BaseTools/Source/Python/Common/Misc.py | 2 --
 1 file changed, 2 deletions(-)

diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py
index 76a73d1c33..feb2c7e394 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -1523,12 +1523,10 @@ def AnalyzeDscPcd(Setting, PcdType, DataType=''):
             Guid = FieldList[1]
         if len(FieldList) > 2:
             Offset = FieldList[2]
         if len(FieldList) > 3:
             Value = FieldList[3]
-            if not Value:
-                IsValid = False
         if len(FieldList) > 4:
             Attribute = FieldList[4]
         return [HiiString, Guid, Offset, Value, Attribute], IsValid, 3
     return [], False, 0
 
-- 
2.19.1.windows.1



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

* Re: [Patch] BaseTools: Allow empty value for HiiPcd in Dsc
  2019-01-16 16:21 [Patch] BaseTools: Allow empty value for HiiPcd in Dsc Feng, Bob C
@ 2019-01-17 14:09 ` Gao, Liming
  0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2019-01-17 14:09 UTC (permalink / raw)
  To: Feng, Bob C, edk2-devel@lists.01.org; +Cc: Carsey, Jaben

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

> -----Original Message-----
> From: Feng, Bob C
> Sent: Thursday, January 17, 2019 12:22 AM
> To: edk2-devel@lists.01.org
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>; Carsey, Jaben <jaben.carsey@intel.com>
> Subject: [Patch] BaseTools: Allow empty value for HiiPcd in Dsc
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=1466
> 
> DEC file defines PCD default value and PCD supported type.
> DSC can configure PCD type and value.
> If the value is same to default value in DEC file,
> DSC can only configure PCD type and leave empty for value.
> This usage supports all type PCD except for DynamicHii type.
> So, DynamicHii PCD should support this usage. Below is one example in DSC.
> 
> for example,
> [PcdsDynamicHii.common.DEFAULT]
> PcdPkgTokenSpaceGuid.PcdCName|L"VarName"|gVarGuid|0x00||NV,BS
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Jaben Carsey <jaben.carsey@intel.com>
> ---
>  BaseTools/Source/Python/Common/Misc.py | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py
> index 76a73d1c33..feb2c7e394 100644
> --- a/BaseTools/Source/Python/Common/Misc.py
> +++ b/BaseTools/Source/Python/Common/Misc.py
> @@ -1523,12 +1523,10 @@ def AnalyzeDscPcd(Setting, PcdType, DataType=''):
>              Guid = FieldList[1]
>          if len(FieldList) > 2:
>              Offset = FieldList[2]
>          if len(FieldList) > 3:
>              Value = FieldList[3]
> -            if not Value:
> -                IsValid = False
>          if len(FieldList) > 4:
>              Attribute = FieldList[4]
>          return [HiiString, Guid, Offset, Value, Attribute], IsValid, 3
>      return [], False, 0
> 
> --
> 2.19.1.windows.1



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

end of thread, other threads:[~2019-01-17 14:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-16 16:21 [Patch] BaseTools: Allow empty value for HiiPcd in Dsc Feng, Bob C
2019-01-17 14:09 ` Gao, Liming

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