> Assuming the maintainers are fine with the patch as well, I suggest that
> they please replace the word "initializations" with "assignments" in the
> subject, to be pedantic on the C-lang level.

Well, that's why I said "initializations" instead of "initializers", but if
it's more clear to you, I'm fine with your way.

> (Side note: I would even move OldSize to a lot tighter scope:
> 
> > diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7Verify.c 
> > b/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7Verify.c
> > index d564591cb7f9..31a9ecd59ff6 100644
> > --- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7Verify.c
> > +++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7Verify.c
> > @@ -477,7 +477,6 @@ Pkcs7GetCertificatesList (
> >    UINT8            *CertBuf;
> >    UINT8            *OldBuf;
> >    UINTN            BufferSize;
> > -  UINTN            OldSize;
> >    UINT8            *SingleCert;
> >    UINTN            CertSize;
> >
> > @@ -612,10 +611,11 @@ Pkcs7GetCertificatesList (
> >
> >    if (CtxChain != NULL) {
> >      BufferSize = sizeof (UINT8);
> > -    OldSize    = BufferSize;
> >      CertBuf    = NULL;
> >
> >      for (Index = 0; ; Index++) {
> > +      UINTN OldSize;
> > +
> >        Status = X509PopCertificate (CtxChain, &SingleCert, &CertSize);
> >        if (!Status) {
> >          break;
> > @@ -656,10 +656,11 @@ Pkcs7GetCertificatesList (
> >
> >    if (CtxUntrusted != NULL) {
> >      BufferSize = sizeof (UINT8);
> > -    OldSize    = BufferSize;
> >      CertBuf    = NULL;
> >
> >      for (Index = 0; ; Index++) {
> > +      UINTN OldSize;
> > +
> >        Status = X509PopCertificate (CtxUntrusted, &SingleCert, &CertSize);
> >        if (!Status) {
> >          break;
> 
> However, many edk2 maintainers don't like tight scoping like this.)

I had considered this and guessed it was probably against the coding style or
it would have been done this way already.  IMO it's better in every way.

-- 
  Peter
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to