From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web09.3820.1615777030402164631 for ; Sun, 14 Mar 2021 19:57:12 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Mon, 15 Mar 2021 10:57:06 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: "'Laszlo Ersek'" , Cc: "'Jian J Wang'" , "'Hao A Wu'" , References: <20210309012416.1981-1-gaoliming@byosoft.com.cn> <1b5cdecc-35f5-cfa1-914a-e2b674fe66b6@redhat.com> In-Reply-To: <1b5cdecc-35f5-cfa1-914a-e2b674fe66b6@redhat.com> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIXSBNZGVNb2R1bGVQa2c6IEluaXRpYWxpemUgbG9jYWwgdmFyaWFibGUgdmFsdWUgYmVmb3JlIHRoZXkgYXJlIHVzZWQ=?= Date: Mon, 15 Mar 2021 10:57:06 +0800 Message-ID: <008d01d71946$e24e8200$a6eb8600$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQFgmBTtIriblaX8ocqfGegJvbkskgGDoCC9q2U9CqA= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Laszlo: I agree your comments. I will update the patch to include the comments = in code and commit message.=20 Thanks Liming > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: Laszlo Ersek > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: = 2021=E5=B9=B43=E6=9C=8812=E6=97=A5 1:22 > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; = gaoliming@byosoft.com.cn > =E6=8A=84=E9=80=81: Jian J Wang ; Hao A Wu > ; sergei@posteo.net > =E4=B8=BB=E9=A2=98: Re: [edk2-devel] [PATCH] MdeModulePkg: Initialize = local variable value > before they are used >=20 > Hi Liming, >=20 > On 03/09/21 02:24, gaoliming wrote: > > This change is to fix the compiler error on GCC49 release build. > > > > Cc: Jian J Wang > > Cc: Hao A Wu > > Signed-off-by: Liming Gao > > --- > > 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 =3D NULL; > > PciIo =3D Instance->PciIo; > > + Status =3D EFI_SUCCESS; > > > > if (PciIo =3D=3D 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 =3D 0; > > TotalSize =3D sizeof( VARIABLE_POLICY_ENTRY ); > > if (Name !=3D NULL) { > > NameSize =3D StrnSizeS( Name, MAX_UINT16 ); > > >=20 > (1) we have a bugzilla ticket related to this (or more precisely, > overlapping AtaAtapiPassThru): >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D3228 >=20 > I think mentioning the BZ in the commit message might make sense. >=20 > (2) Recently we have used a special comment format for such = assignments. > Namely: >=20 > // > // Set Status to suppress incorrect compiler/analyzer warnings > // > Status =3D EFI_SUCCESS; >=20 > 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). >=20 > Thanks! > Laszlo