public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v1 1/1] CryptoPkg/BaseCryptLib: remove some duplicate initializations.
@ 2017-10-20 15:10 Peter Jones
  2017-10-20 17:12 ` Laszlo Ersek
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Jones @ 2017-10-20 15:10 UTC (permalink / raw)
  To: edk2-devel

clang-analyzer noticed this:

Pk/CryptPkcs7Verify.c:600:5: warning: Value stored to 'OldSize' is never read
    OldSize    = BufferSize;
    ^            ~~~~~~~~~~
Pk/CryptPkcs7Verify.c:644:5: warning: Value stored to 'OldSize' is never read
    OldSize    = BufferSize;
    ^            ~~~~~~~~~~
2 warnings generated.

These are each immediately followed by a loop that initializes them (to
the same values) a second time, and are otherwise only referenced inside
that loop, so there's just no point to these assignments at all.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Peter Jones <pjones@redhat.com>
---
 CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7Verify.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7Verify.c b/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7Verify.c
index d564591cb7f9..bf67a1f569a2 100644
--- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7Verify.c
+++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7Verify.c
@@ -612,7 +612,6 @@ Pkcs7GetCertificatesList (
 
   if (CtxChain != NULL) {
     BufferSize = sizeof (UINT8);
-    OldSize    = BufferSize;
     CertBuf    = NULL;
 
     for (Index = 0; ; Index++) {
@@ -656,7 +655,6 @@ Pkcs7GetCertificatesList (
 
   if (CtxUntrusted != NULL) {
     BufferSize = sizeof (UINT8);
-    OldSize    = BufferSize;
     CertBuf    = NULL;
 
     for (Index = 0; ; Index++) {
-- 
2.14.2



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

end of thread, other threads:[~2017-10-24  8:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-20 15:10 [PATCH v1 1/1] CryptoPkg/BaseCryptLib: remove some duplicate initializations Peter Jones
2017-10-20 17:12 ` Laszlo Ersek
2017-10-20 18:21   ` Peter Jones
2017-10-23  3:02     ` Long, Qin
2017-10-24  7:51       ` Laszlo Ersek
2017-10-24  8:15         ` Long, Qin

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