]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg: Fix Ecc error 7008 for SCMI_CLOCK_RATE
authorPierre Gondois <Pierre.Gondois@arm.com>
Fri, 8 Jan 2021 14:06:20 +0000 (14:06 +0000)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 15 Apr 2021 19:53:39 +0000 (19:53 +0000)
This patch fixes the following Ecc reported error:
Complex types should be typedef-ed

The error is due to the a nested structure declaration.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
ArmPkg/Drivers/ArmScmiDxe/ScmiClockProtocol.c
ArmPkg/Include/Protocol/ArmScmiClockProtocol.h

index c66c414385ddff4c8ad46189621f7d477c13a873..5c06e31bda226643d1c09c0c268dfc4f0ed1f98f 100644 (file)
@@ -255,22 +255,26 @@ ClockDescribeRates (
       for (RateNo = 0; RateNo < NUM_RATES (DescribeRates->NumRatesFlags); RateNo++) {\r
         Rate = &DescribeRates->Rates[RateOffset++];\r
         // Non-linear discrete rates.\r
-        RateArray[RateIndex++].Rate = ConvertTo64Bit (Rate->Low, Rate->High);\r
+        RateArray[RateIndex++].DiscreteRate.Rate =\r
+          ConvertTo64Bit (Rate->Low, Rate->High);\r
       }\r
     } else {\r
       for (RateNo = 0; RateNo < NUM_RATES (DescribeRates->NumRatesFlags); RateNo++) {\r
         // Linear clock rates from minimum to maximum in steps\r
         // Minimum clock rate.\r
         Rate = &DescribeRates->Rates[RateOffset++];\r
-        RateArray[RateIndex].Min = ConvertTo64Bit (Rate->Low, Rate->High);\r
+        RateArray[RateIndex].ContinuousRate.Min =\r
+          ConvertTo64Bit (Rate->Low, Rate->High);\r
 \r
         Rate = &DescribeRates->Rates[RateOffset++];\r
         // Maximum clock rate.\r
-        RateArray[RateIndex].Max = ConvertTo64Bit (Rate->Low, Rate->High);\r
+        RateArray[RateIndex].ContinuousRate.Max =\r
+          ConvertTo64Bit (Rate->Low, Rate->High);\r
 \r
         Rate = &DescribeRates->Rates[RateOffset++];\r
         // Step.\r
-        RateArray[RateIndex++].Step = ConvertTo64Bit (Rate->Low, Rate->High);\r
+        RateArray[RateIndex++].ContinuousRate.Step =\r
+          ConvertTo64Bit (Rate->Low, Rate->High);\r
       }\r
     }\r
   } while (NUM_REMAIN_RATES (DescribeRates->NumRatesFlags) != 0);\r
index b4d970dee3e2b75adbe8d877255ce405d0d27644..85b5b8d1e764e3d963eb8a97b5d46e24022a9033 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-  Copyright (c) 2017-2018, Arm Limited. All rights reserved.\r
+  Copyright (c) 2017-2021, Arm Limited. All rights reserved.\r
 \r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
@@ -57,12 +57,18 @@ typedef enum {
    either Rate or Min/Max/Step triplet is valid.\r
 */\r
 typedef struct {\r
-  union {\r
   UINT64 Min;\r
-  UINT64 Rate;\r
-  };\r
   UINT64 Max;\r
   UINT64 Step;\r
+} SCMI_CLOCK_RATE_CONTINUOUS;\r
+\r
+typedef struct {\r
+  UINT64 Rate;\r
+} SCMI_CLOCK_RATE_DISCRETE;\r
+\r
+typedef union {\r
+  SCMI_CLOCK_RATE_CONTINUOUS ContinuousRate;\r
+  SCMI_CLOCK_RATE_DISCRETE DiscreteRate;\r
 } SCMI_CLOCK_RATE;\r
 \r
 #pragma pack()\r