From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web08.61.1608139362259890732 for ; Wed, 16 Dec 2020 09:22:42 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: pierre.gondois@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E42821FB; Wed, 16 Dec 2020 09:22:41 -0800 (PST) Received: from e120189.arm.com (unknown [10.57.25.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CC2AD3F66E; Wed, 16 Dec 2020 09:22:40 -0800 (PST) From: "PierreGondois" To: devel@edk2.groups.io, ard.biesheuvel@arm.com, leif@nuviainc.com Cc: sami.mujawar@arm.com Subject: [PATCH v1 14/25] ArmPkg: Fix Ecc error 5007 in ArmScmiDxe Date: Wed, 16 Dec 2020 17:21:49 +0000 Message-Id: <20201216172200.25846-15-Pierre.Gondois@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201216172200.25846-1-Pierre.Gondois@arm.com> References: <20201216172200.25846-1-Pierre.Gondois@arm.com> From: Pierre Gondois This patch fixes the following Ecc reported error: There should be no initialization of a variable as part of its declaration Signed-off-by: Pierre Gondois --- The changes can be seen at: https://github.com/PierreARM/edk2/commits/1552_Ecc_ArmPkg_v1 ArmPkg/Drivers/ArmScmiDxe/Scmi.c | 5 +++-- ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ArmPkg/Drivers/ArmScmiDxe/Scmi.c b/ArmPkg/Drivers/ArmScmiDxe/Scmi.c index c4af3ec4ecc1..3e62f2b1a48c 100644 --- a/ArmPkg/Drivers/ArmScmiDxe/Scmi.c +++ b/ArmPkg/Drivers/ArmScmiDxe/Scmi.c @@ -1,6 +1,6 @@ /** @file - Copyright (c) 2017-2018, Arm Limited. All rights reserved. + Copyright (c) 2017-2020, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -161,8 +161,9 @@ ScmiProtocolDiscoveryCommon ( ) { SCMI_COMMAND Command; - UINT32 PayloadLength = 0; + UINT32 PayloadLength; + PayloadLength = 0; Command.ProtocolId = ProtocolId; Command.MessageId = MessageId; diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c b/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c index ac0d21d862b3..8002e039c98a 100644 --- a/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c +++ b/ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c @@ -1,6 +1,6 @@ /** @file - Copyright (c) 2017-2018, Arm Limited. All rights reserved. + Copyright (c) 2017-2020, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -189,12 +189,14 @@ ClockDescribeRates ( CLOCK_DESCRIBE_RATES *DescribeRates; CLOCK_RATE_DWORD *Rate; - UINT32 RequiredArraySize = 0; - UINT32 RateIndex = 0; + UINT32 RequiredArraySize; + UINT32 RateIndex; UINT32 RateNo; UINT32 RateOffset; *TotalRates = 0; + RequiredArraySize = 0; + RateIndex = 0; Status = ScmiCommandGetPayload (&MessageParams); if (EFI_ERROR (Status)) { -- 2.17.1