Laszlo: I agree your comments. I will update the patch to include the comments in code and commit message.
Thanks Liming > -----邮件原件----- > 发件人: Laszlo Ersek <ler...@redhat.com> > 发送时间: 2021年3月12日 1:22 > 收件人: devel@edk2.groups.io; gaolim...@byosoft.com.cn > 抄送: Jian J Wang <jian.j.w...@intel.com>; Hao A Wu > <hao.a...@intel.com>; ser...@posteo.net > 主题: Re: [edk2-devel] [PATCH] MdeModulePkg: Initialize local variable value > before they are used > > Hi Liming, > > On 03/09/21 02:24, gaoliming wrote: > > This change is to fix the compiler error on GCC49 release build. > > > > Cc: Jian J Wang <jian.j.w...@intel.com> > > Cc: Hao A Wu <hao.a...@intel.com> > > Signed-off-by: Liming Gao <gaolim...@byosoft.com.cn> > > --- > > MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c > | 1 + > > .../Library/VariablePolicyHelperLib/VariablePolicyHelperLib.c | 1 + > > 2 files changed, 2 insertions(+) > > > > diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c > b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c > > index e99a812a44..0779f94f9e 100644 > > --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c > > +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c > > @@ -1122,6 +1122,7 @@ AhciDmaTransfer ( > > > > Map = NULL; > > PciIo = Instance->PciIo; > > + Status = EFI_SUCCESS; > > > > if (PciIo == NULL) { > > return EFI_INVALID_PARAMETER; > > diff --git > a/MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.c > b/MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.c > > index 0c9299c8b0..7822cbf4bb 100644 > > --- > a/MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.c > > +++ > b/MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.c > > @@ -117,6 +117,7 @@ CreateBasicVariablePolicy ( > > > > // Now we've gotta determine the total size of the buffer required for > > // the VariablePolicy structure. > > + NameSize = 0; > > TotalSize = sizeof( VARIABLE_POLICY_ENTRY ); > > if (Name != NULL) { > > NameSize = StrnSizeS( Name, MAX_UINT16 ); > > > > (1) we have a bugzilla ticket related to this (or more precisely, > overlapping AtaAtapiPassThru): > > https://bugzilla.tianocore.org/show_bug.cgi?id=3228 > > I think mentioning the BZ in the commit message might make sense. > > (2) Recently we have used a special comment format for such assignments. > Namely: > > // > // Set Status to suppress incorrect compiler/analyzer warnings > // > Status = EFI_SUCCESS; > > Hao already requested that we should document that we only suppress > compiler false positives with these assignments -- they are not needed > functionally. However, I think saying so in the commit message *only* is > not sufficient. I think we should stick with the above code-comment > format (which we've used recently in several places). > > Thanks! > Laszlo -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#72753): https://edk2.groups.io/g/devel/message/72753 Mute This Topic: https://groups.io/mt/81341126/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-