From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=pjones@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A6BEC202E5CFF for ; Fri, 20 Oct 2017 08:06:42 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1C7AF820FE for ; Fri, 20 Oct 2017 15:10:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1C7AF820FE Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pjones@redhat.com Received: from trillian.uncooperative.org.com (dhcp-10-20-1-221.bss.redhat.com [10.20.1.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id C849960BE1 for ; Fri, 20 Oct 2017 15:10:20 +0000 (UTC) From: Peter Jones To: edk2-devel@lists.01.org Date: Fri, 20 Oct 2017 11:10:18 -0400 Message-Id: <20171020151018.785-1-pjones@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 20 Oct 2017 15:10:21 +0000 (UTC) Subject: [PATCH v1 1/1] CryptoPkg/BaseCryptLib: remove some duplicate initializations. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 15:06:42 -0000 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 --- 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