public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg
@ 2020-12-03 18:19 PierreGondois
  2020-12-03 18:19 ` [PATCH v1 01/16] ArmPlatformPkg: Fix Ecc error 3001 in NorFlashDxe PierreGondois
                   ` (16 more replies)
  0 siblings, 17 replies; 19+ messages in thread
From: PierreGondois @ 2020-12-03 18:19 UTC (permalink / raw)
  To: leif, ard.biesheuvel, thomas.abraham, devel; +Cc: sami.mujawar

From: Pierre Gondois <Pierre.Gondois@arm.com>

The Ecc tools available in the BaseTools package checks for
good practice coding standards. Some errors reported while
running Ecc on edk2/ArmPlatformPkg require modifications.

This patch set has a dependency over a similar patch set
named "Fix Ecc reported errors from ArmPlatformPkg" for
edk2-platforms and should not be merged independently.

The changes can be seen at: https://github.com/PierreARM/edk2/tree/1537_Ecc_ArmPlatformPkg_v1

Pierre Gondois (16):
  ArmPlatformPkg: Fix Ecc error 3001 in NorFlashDxe
  ArmPlatformPkg: Fix Ecc error 3002 in PL011UartLib
  ArmPlatformPkg: Fix Ecc error 3002 in PL061GpioDxe
  ArmPlatformPkg: Fix Ecc error 5007 in LcdGraphicsOutputDxe
  ArmPlatformPkg: Fix Ecc error 5007 in NorFlashDxe
  ArmPlatformPkg: Fix Ecc error 5007 in PL061GpioDxe
  ArmPlatformPkg: Fix Ecc error 5007 in PL031RealTimeClockLib
  ArmPlatformPkg: Fix Ecc error 10016 in PrePi
  ArmPlatformPkg: Fix Ecc error 10016 in LcdPlatformNullLib
  ArmPlatformPkg: Fix Ecc error 10014 in LcdGraphicsOutputDxe
  ArmPlatformPkg: Fix Ecc error 10014 in PL061GpioDxe
  ArmPlatformPkg: Fix Ecc error 10014 in SP805WatchdogDxe
  ArmPlatformPkg: Fix Ecc error 10006 in ArmPlatformPkg.dsc
  ArmPlatformPkg: Fix Ecc error 8001 in PrePi
  ArmPlatformPkg: Fix Ecc error 8005
  ArmPlatformPkg: Fix cspell reported spelling/wording

 ArmPlatformPkg/ArmPlatformPkg.dsc             |  9 +-
 .../LcdGraphicsOutputBlt.c                    | 98 ++++++++++---------
 .../LcdGraphicsOutputDxe.c                    | 30 +++---
 .../LcdGraphicsOutputDxe.h                    |  4 +-
 .../LcdGraphicsOutputDxe.inf                  |  5 +-
 .../Drivers/NorFlashDxe/NorFlashDxe.c         |  8 +-
 .../Drivers/PL061GpioDxe/PL061Gpio.c          | 12 +--
 .../Drivers/PL061GpioDxe/PL061GpioDxe.inf     |  3 +-
 .../SP805WatchdogDxe/SP805WatchdogDxe.inf     |  3 +-
 .../Include/Library/LcdPlatformLib.h          | 21 ++--
 .../LcdPlatformNullLib/LcdPlatformNullLib.c   |  4 +-
 .../LcdPlatformNullLib/LcdPlatformNullLib.inf |  3 +-
 .../Library/PL011UartLib/PL011UartLib.c       | 12 +--
 .../PL031RealTimeClockLib.c                   |  4 +-
 ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c    |  4 +-
 .../PrePi/AArch64/ModuleEntryPoint.S          |  4 +-
 ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.S   |  4 +-
 ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.asm |  4 +-
 ArmPlatformPkg/PrePi/PeiUniCore.inf           |  3 +-
 ArmPlatformPkg/PrePi/PrePi.h                  |  4 +-
 20 files changed, 126 insertions(+), 113 deletions(-)

--
2.17.1


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

* [PATCH v1 01/16] ArmPlatformPkg: Fix Ecc error 3001 in NorFlashDxe
  2020-12-03 18:19 [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg PierreGondois
@ 2020-12-03 18:19 ` PierreGondois
  2020-12-03 18:19 ` [PATCH v1 02/16] ArmPlatformPkg: Fix Ecc error 3002 in PL011UartLib PierreGondois
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: PierreGondois @ 2020-12-03 18:19 UTC (permalink / raw)
  To: leif, ard.biesheuvel, thomas.abraham, devel; +Cc: sami.mujawar

From: Pierre Gondois <Pierre.Gondois@arm.com>

This patch fixes the following Ecc reported error:
Boolean values and variable type BOOLEAN should not use
explicit comparisons to TRUE or FALSE

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 The changes can be seen at: https://github.com/PierreARM/edk2-platforms/tree/1537_Ecc_ArmPlatformPkg_v1

 ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
index d9e196cbf18c32fe5306cc3c0674a7b5798a9191..b681c4b4668630de8a9585363a328b3e3f1bc324 100644
--- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
+++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
@@ -1,6 +1,6 @@
 /** @file  NorFlashDxe.c

-  Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>
+  Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -259,7 +259,7 @@ NorFlashUnlockSingleBlockIfNecessary (

   Status = EFI_SUCCESS;

-  if (NorFlashBlockIsLocked (Instance, BlockAddress) == TRUE) {
+  if (NorFlashBlockIsLocked (Instance, BlockAddress)) {
     Status = NorFlashUnlockSingleBlock (Instance, BlockAddress);
   }

--
2.17.1


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

* [PATCH v1 02/16] ArmPlatformPkg: Fix Ecc error 3002 in PL011UartLib
  2020-12-03 18:19 [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg PierreGondois
  2020-12-03 18:19 ` [PATCH v1 01/16] ArmPlatformPkg: Fix Ecc error 3001 in NorFlashDxe PierreGondois
@ 2020-12-03 18:19 ` PierreGondois
  2020-12-03 18:19 ` [PATCH v1 03/16] ArmPlatformPkg: Fix Ecc error 3002 in PL061GpioDxe PierreGondois
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: PierreGondois @ 2020-12-03 18:19 UTC (permalink / raw)
  To: leif, ard.biesheuvel, thomas.abraham, devel; +Cc: sami.mujawar

From: Pierre Gondois <Pierre.Gondois@arm.com>

This patch fixes the following Ecc reported error:
Non-Boolean comparisons should use a compare operator
(==, !=, >, < >=, <=)

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 The changes can be seen at: https://github.com/PierreARM/edk2-platforms/tree/1537_Ecc_ArmPlatformPkg_v1

 ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c b/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c
index f1015b1fce33a8188915b3bbeda81c2c37e35cb0..3c58a0f39acb3867048f46c25ec1d41930a2b2ee 100644
--- a/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c
+++ b/ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.c
@@ -2,7 +2,7 @@
   Serial I/O Port library functions with no library constructor/destructor

   Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
-  Copyright (c) 2011 - 2016, ARM Ltd. All rights reserved.<BR>
+  Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -269,31 +269,31 @@ PL011UartSetControl (
 {
   UINT32  Bits;

-  if (Control & (mInvalidControlBits)) {
+  if ((Control & mInvalidControlBits) != 0) {
     return RETURN_UNSUPPORTED;
   }

   Bits = MmioRead32 (UartBase + UARTCR);

-  if (Control & EFI_SERIAL_REQUEST_TO_SEND) {
+  if ((Control & EFI_SERIAL_REQUEST_TO_SEND) != 0) {
     Bits |= PL011_UARTCR_RTS;
   } else {
     Bits &= ~PL011_UARTCR_RTS;
   }

-  if (Control & EFI_SERIAL_DATA_TERMINAL_READY) {
+  if ((Control & EFI_SERIAL_DATA_TERMINAL_READY) != 0) {
     Bits |= PL011_UARTCR_DTR;
   } else {
     Bits &= ~PL011_UARTCR_DTR;
   }

-  if (Control & EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE) {
+  if ((Control & EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE) != 0) {
     Bits |= PL011_UARTCR_LBE;
   } else {
     Bits &= ~PL011_UARTCR_LBE;
   }

-  if (Control & EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE) {
+  if ((Control & EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE) != 0) {
     Bits |= (PL011_UARTCR_CTSEN | PL011_UARTCR_RTSEN);
   } else {
     Bits &= ~(PL011_UARTCR_CTSEN | PL011_UARTCR_RTSEN);
--
2.17.1


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

* [PATCH v1 03/16] ArmPlatformPkg: Fix Ecc error 3002 in PL061GpioDxe
  2020-12-03 18:19 [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg PierreGondois
  2020-12-03 18:19 ` [PATCH v1 01/16] ArmPlatformPkg: Fix Ecc error 3001 in NorFlashDxe PierreGondois
  2020-12-03 18:19 ` [PATCH v1 02/16] ArmPlatformPkg: Fix Ecc error 3002 in PL011UartLib PierreGondois
@ 2020-12-03 18:19 ` PierreGondois
  2020-12-03 18:19 ` [PATCH v1 04/16] ArmPlatformPkg: Fix Ecc error 5007 in LcdGraphicsOutputDxe PierreGondois
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: PierreGondois @ 2020-12-03 18:19 UTC (permalink / raw)
  To: leif, ard.biesheuvel, thomas.abraham, devel; +Cc: sami.mujawar

From: Pierre Gondois <Pierre.Gondois@arm.com>

This patch fixes the following Ecc reported error:
Non-Boolean comparisons should use a compare operator
(==, !=, >, < >=, <=)

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 The changes can be seen at: https://github.com/PierreARM/edk2-platforms/tree/1537_Ecc_ArmPlatformPkg_v1

 ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c
index 778bd6858f41f972734b0ea57058c18a053e4338..020d8c9fd92a38783305680980cc9159345e380e 100644
--- a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c
+++ b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2011, ARM Limited. All rights reserved.
+*  Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
 *  Copyright (c) 2016, Linaro Limited. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -181,7 +181,7 @@ Get (
     return EFI_INVALID_PARAMETER;
   }

-  if (PL061GetPins (RegisterBase, GPIO_PIN_MASK(Offset))) {
+  if (PL061GetPins (RegisterBase, GPIO_PIN_MASK(Offset)) != 0) {
     *Value = 1;
   } else {
     *Value = 0;
@@ -292,7 +292,7 @@ GetMode (
   // Check if it is input or output
   if (MmioRead8 (RegisterBase + PL061_GPIO_DIR_REG) & GPIO_PIN_MASK(Offset)) {
     // Pin set to output
-    if (PL061GetPins (RegisterBase, GPIO_PIN_MASK(Offset))) {
+    if (PL061GetPins (RegisterBase, GPIO_PIN_MASK(Offset)) != 0) {
       *Mode = GPIO_MODE_OUTPUT_1;
     } else {
       *Mode = GPIO_MODE_OUTPUT_0;
--
2.17.1


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

* [PATCH v1 04/16] ArmPlatformPkg: Fix Ecc error 5007 in LcdGraphicsOutputDxe
  2020-12-03 18:19 [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg PierreGondois
                   ` (2 preceding siblings ...)
  2020-12-03 18:19 ` [PATCH v1 03/16] ArmPlatformPkg: Fix Ecc error 3002 in PL061GpioDxe PierreGondois
@ 2020-12-03 18:19 ` PierreGondois
  2020-12-03 18:19 ` [PATCH v1 05/16] ArmPlatformPkg: Fix Ecc error 5007 in NorFlashDxe PierreGondois
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: PierreGondois @ 2020-12-03 18:19 UTC (permalink / raw)
  To: leif, ard.biesheuvel, thomas.abraham, devel; +Cc: sami.mujawar

From: Pierre Gondois <Pierre.Gondois@arm.com>

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 <Pierre.Gondois@arm.com>
---
 The changes can be seen at: https://github.com/PierreARM/edk2-platforms/tree/1537_Ecc_ArmPlatformPkg_v1

 ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputBlt.c | 10 +++++++---
 ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c | 10 +++++-----
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputBlt.c b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputBlt.c
index c865215ec68ecba1e809108cffec9354f042561e..07d2cb0d5dec0f85219fe5cdc438e18ae3a32a38 100644
--- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputBlt.c
+++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputBlt.c
@@ -1,6 +1,6 @@
 /** @file

- Copyright (c) 2011-2013, ARM Ltd. All rights reserved.<BR>
+ Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
  SPDX-License-Identifier: BSD-2-Clause-Patent

  **/
@@ -36,7 +36,7 @@ VideoCopyNoHorizontalOverlap (
   IN UINTN          Height
 )
 {
-  EFI_STATUS    Status = EFI_SUCCESS;
+  EFI_STATUS    Status;
   UINTN         SourceLine;
   UINTN         DestinationLine;
   UINTN         WidthInBytes;
@@ -45,6 +45,8 @@ VideoCopyNoHorizontalOverlap (
   VOID          *SourceAddr;
   VOID          *DestinationAddr;

+  Status = EFI_SUCCESS;
+
   if( DestinationY <= SourceY ) {
     // scrolling up (or horizontally but without overlap)
     SourceLine       = SourceY;
@@ -128,7 +130,7 @@ VideoCopyHorizontalOverlap (
   IN UINTN          Height
 )
 {
-  EFI_STATUS      Status = EFI_SUCCESS;
+  EFI_STATUS      Status;

   UINT32 *PixelBuffer32bit;
   UINT32 *SourcePixel32bit;
@@ -143,6 +145,8 @@ VideoCopyHorizontalOverlap (
   UINTN           SizeIn32Bits;
   UINTN           SizeIn16Bits;

+  Status = EFI_SUCCESS;
+
   switch (BitsPerPixel) {

   case LCD_BITS_PER_PIXEL_24:
diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c
index f1f104858d8ed456089180e6e82bcc54d4b46b62..bfd03d8f84258158e76690cc5a0d9333f11d67f0 100644
--- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c
+++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c
@@ -1,7 +1,7 @@
 /** @file
   This file implements the Graphics Output protocol for Arm platforms

-  Copyright (c) 2011-2018, ARM Ltd. All rights reserved.<BR>
+  Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent

 **/
@@ -102,7 +102,7 @@ InitializeDisplay (
   IN LCD_INSTANCE* Instance
   )
 {
-  EFI_STATUS             Status = EFI_SUCCESS;
+  EFI_STATUS             Status;
   EFI_PHYSICAL_ADDRESS   VramBaseAddress;
   UINTN                  VramSize;

@@ -148,7 +148,7 @@ LcdGraphicsOutputDxeInitialize (
   IN EFI_SYSTEM_TABLE   *SystemTable
   )
 {
-  EFI_STATUS  Status = EFI_SUCCESS;
+  EFI_STATUS  Status;
   LCD_INSTANCE* Instance;

   Status = LcdIdentify ();
@@ -246,7 +246,7 @@ LcdGraphicsQueryMode (
   OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION   **Info
   )
 {
-  EFI_STATUS Status = EFI_SUCCESS;
+  EFI_STATUS Status;
   LCD_INSTANCE *Instance;

   Instance = LCD_INSTANCE_FROM_GOP_THIS (This);
@@ -296,7 +296,7 @@ LcdGraphicsSetMode (
   IN UINT32                         ModeNumber
   )
 {
-  EFI_STATUS                      Status = EFI_SUCCESS;
+  EFI_STATUS                      Status;
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL   FillColour;
   LCD_INSTANCE*                   Instance;
   LCD_BPP                         Bpp;
--
2.17.1


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

* [PATCH v1 05/16] ArmPlatformPkg: Fix Ecc error 5007 in NorFlashDxe
  2020-12-03 18:19 [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg PierreGondois
                   ` (3 preceding siblings ...)
  2020-12-03 18:19 ` [PATCH v1 04/16] ArmPlatformPkg: Fix Ecc error 5007 in LcdGraphicsOutputDxe PierreGondois
@ 2020-12-03 18:19 ` PierreGondois
  2020-12-03 18:19 ` [PATCH v1 06/16] ArmPlatformPkg: Fix Ecc error 5007 in PL061GpioDxe PierreGondois
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: PierreGondois @ 2020-12-03 18:19 UTC (permalink / raw)
  To: leif, ard.biesheuvel, thomas.abraham, devel; +Cc: sami.mujawar

From: Pierre Gondois <Pierre.Gondois@arm.com>

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 <Pierre.Gondois@arm.com>
---
 The changes can be seen at: https://github.com/PierreARM/edk2-platforms/tree/1537_Ecc_ArmPlatformPkg_v1

 ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
index b681c4b4668630de8a9585363a328b3e3f1bc324..20134094badcb5bee14f66a9c38b8d5bbf68ceaa 100644
--- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
+++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
@@ -676,12 +676,14 @@ NorFlashWriteBlocks (
   )
 {
   UINT32          *pWriteBuffer;
-  EFI_STATUS      Status = EFI_SUCCESS;
+  EFI_STATUS      Status;
   EFI_LBA         CurrentBlock;
   UINT32          BlockSizeInWords;
   UINT32          NumBlocks;
   UINT32          BlockCount;

+  Status = EFI_SUCCESS;
+
   // The buffer must be valid
   if (Buffer == NULL) {
     return EFI_INVALID_PARAMETER;
--
2.17.1


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

* [PATCH v1 06/16] ArmPlatformPkg: Fix Ecc error 5007 in PL061GpioDxe
  2020-12-03 18:19 [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg PierreGondois
                   ` (4 preceding siblings ...)
  2020-12-03 18:19 ` [PATCH v1 05/16] ArmPlatformPkg: Fix Ecc error 5007 in NorFlashDxe PierreGondois
@ 2020-12-03 18:19 ` PierreGondois
  2020-12-03 18:19 ` [PATCH v1 07/16] ArmPlatformPkg: Fix Ecc error 5007 in PL031RealTimeClockLib PierreGondois
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: PierreGondois @ 2020-12-03 18:19 UTC (permalink / raw)
  To: leif, ard.biesheuvel, thomas.abraham, devel; +Cc: sami.mujawar

From: Pierre Gondois <Pierre.Gondois@arm.com>

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 <Pierre.Gondois@arm.com>
---
 The changes can be seen at: https://github.com/PierreARM/edk2-platforms/tree/1537_Ecc_ArmPlatformPkg_v1

 ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c
index 020d8c9fd92a38783305680980cc9159345e380e..be0e1c096360d08d9da6888d77dd0e4556fd4b02 100644
--- a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c
+++ b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c
@@ -171,7 +171,7 @@ Get (
   OUT UINTN             *Value
   )
 {
-  EFI_STATUS    Status = EFI_SUCCESS;
+  EFI_STATUS    Status;
   UINTN         Index, Offset, RegisterBase;

   Status = PL061Locate (Gpio, &Index, &Offset, &RegisterBase);
@@ -216,7 +216,7 @@ Set (
   IN  EMBEDDED_GPIO_MODE  Mode
   )
 {
-  EFI_STATUS    Status = EFI_SUCCESS;
+  EFI_STATUS    Status;
   UINTN         Index, Offset, RegisterBase;

   Status = PL061Locate (Gpio, &Index, &Offset, &RegisterBase);
@@ -278,7 +278,7 @@ GetMode (
   OUT EMBEDDED_GPIO_MODE  *Mode
   )
 {
-  EFI_STATUS    Status = EFI_SUCCESS;
+  EFI_STATUS    Status;
   UINTN         Index, Offset, RegisterBase;

   Status = PL061Locate (Gpio, &Index, &Offset, &RegisterBase);
--
2.17.1


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

* [PATCH v1 07/16] ArmPlatformPkg: Fix Ecc error 5007 in PL031RealTimeClockLib
  2020-12-03 18:19 [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg PierreGondois
                   ` (5 preceding siblings ...)
  2020-12-03 18:19 ` [PATCH v1 06/16] ArmPlatformPkg: Fix Ecc error 5007 in PL061GpioDxe PierreGondois
@ 2020-12-03 18:19 ` PierreGondois
  2020-12-03 18:19 ` [PATCH v1 08/16] ArmPlatformPkg: Fix Ecc error 10016 in PrePi PierreGondois
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: PierreGondois @ 2020-12-03 18:19 UTC (permalink / raw)
  To: leif, ard.biesheuvel, thomas.abraham, devel; +Cc: sami.mujawar

From: Pierre Gondois <Pierre.Gondois@arm.com>

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 <Pierre.Gondois@arm.com>
---
 The changes can be seen at: https://github.com/PierreARM/edk2-platforms/tree/1537_Ecc_ArmPlatformPkg_v1

 ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c
index 75c95985d4707022c87da2e29c799e726aab0bce..0df4ceb1cb39fec80553a61d8a50df415862f502 100644
--- a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c
+++ b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c
@@ -2,7 +2,7 @@
   Implement EFI RealTimeClock runtime services via RTC Lib.

   Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
-  Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>
+  Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
   Copyright (c) 2019, Linaro Ltd. All rights reserved.<BR>

   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -121,7 +121,7 @@ LibGetTime (
   OUT EFI_TIME_CAPABILITIES   *Capabilities
   )
 {
-  EFI_STATUS  Status = EFI_SUCCESS;
+  EFI_STATUS  Status;
   UINT32      EpochSeconds;

   // Ensure Time is a valid pointer
--
2.17.1


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

* [PATCH v1 08/16] ArmPlatformPkg: Fix Ecc error 10016 in PrePi
  2020-12-03 18:19 [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg PierreGondois
                   ` (6 preceding siblings ...)
  2020-12-03 18:19 ` [PATCH v1 07/16] ArmPlatformPkg: Fix Ecc error 5007 in PL031RealTimeClockLib PierreGondois
@ 2020-12-03 18:19 ` PierreGondois
  2020-12-03 18:19 ` [PATCH v1 09/16] ArmPlatformPkg: Fix Ecc error 10016 in LcdPlatformNullLib PierreGondois
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: PierreGondois @ 2020-12-03 18:19 UTC (permalink / raw)
  To: leif, ard.biesheuvel, thomas.abraham, devel; +Cc: sami.mujawar

From: Pierre Gondois <Pierre.Gondois@arm.com>

This patch fixes the following Ecc reported error:
Module file has FILE_GUID collision with other
module file

The two .inf files with clashing GUID are:
edk2\ArmPlatformPkg\PrePi\PeiUniCore.inf
edk2\ArmPlatformPkg\PrePi\PeiMPCore.inf

Both files seem to have been imported from the previous
svn repository as the same time.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 The changes can be seen at: https://github.com/PierreARM/edk2-platforms/tree/1537_Ecc_ArmPlatformPkg_v1

 ArmPlatformPkg/PrePi/PeiUniCore.inf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ArmPlatformPkg/PrePi/PeiUniCore.inf b/ArmPlatformPkg/PrePi/PeiUniCore.inf
index 78d218ae09ca86aa2d77759174118146b97b4576..83a3df78ac26a11366a7bd69d9b29c751d9c01fc 100644
--- a/ArmPlatformPkg/PrePi/PeiUniCore.inf
+++ b/ArmPlatformPkg/PrePi/PeiUniCore.inf
@@ -2,6 +2,7 @@
 #
 #  (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
 #  Copyright (c) 2011-2017, ARM Ltd. All rights reserved.<BR>
+#  Copyright (c) 2020, Arm Limited. All rights reserved.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -10,7 +11,7 @@
 [Defines]
   INF_VERSION                    = 0x00010005
   BASE_NAME                      = ArmPlatformPrePiUniCore
-  FILE_GUID                      = d959e387-7b91-452c-90e0-a1dbac90ddb8
+  FILE_GUID                      = 3e401783-cc94-4fcd-97bc-bd35ac369d2f
   MODULE_TYPE                    = SEC
   VERSION_STRING                 = 1.0

--
2.17.1


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

* [PATCH v1 09/16] ArmPlatformPkg: Fix Ecc error 10016 in LcdPlatformNullLib
  2020-12-03 18:19 [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg PierreGondois
                   ` (7 preceding siblings ...)
  2020-12-03 18:19 ` [PATCH v1 08/16] ArmPlatformPkg: Fix Ecc error 10016 in PrePi PierreGondois
@ 2020-12-03 18:19 ` PierreGondois
  2020-12-03 18:19 ` [PATCH v1 10/16] ArmPlatformPkg: Fix Ecc error 10014 in LcdGraphicsOutputDxe PierreGondois
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: PierreGondois @ 2020-12-03 18:19 UTC (permalink / raw)
  To: leif, ard.biesheuvel, thomas.abraham, devel; +Cc: sami.mujawar

From: Pierre Gondois <Pierre.Gondois@arm.com>

This patch fixes the following Ecc reported error:
Module file has FILE_GUID collision with other
module file

The two .inf files with clashing GUID are:
edk2\ArmPlatformPkg\PrePeiCore\PrePeiCoreMPCore.inf
edk2\ArmPlatformPkg\Library\LcdPlatformNullLib\LcdPlatformNullLib.inf

The PrePeiCoreMPCore module has been omported in 2011 and the
LcdPlatformNullLib module has been created in 2017. The
PrePeiCoreMPCore has the precedence.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 The changes can be seen at: https://github.com/PierreARM/edk2-platforms/tree/1537_Ecc_ArmPlatformPkg_v1

 ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.inf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.inf b/ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.inf
index 55857081692d639e9b010dfdd60f9af676494fb6..21bbe0571f69971070075a89228e6af2cd7e011f 100644
--- a/ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.inf
+++ b/ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.inf
@@ -1,6 +1,7 @@
 #/** @file
 #
 #  Copyright (c) 2017, Linaro, Ltd. All rights reserved.
+#  Copyright (c) 2020, Arm Limited. All rights reserved.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -9,7 +10,7 @@
 [Defines]
   INF_VERSION                    = 0x0001001A
   BASE_NAME                      = LcdPlatformNullLib
-  FILE_GUID                      = b78d02bb-d0b5-4389-bc7f-b39ee846c784
+  FILE_GUID                      = f8bb120b-528f-46e2-92c2-130870af1a20
   MODULE_TYPE                    = BASE
   VERSION_STRING                 = 1.0
   LIBRARY_CLASS                  = LcdPlatformLib
--
2.17.1


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

* [PATCH v1 10/16] ArmPlatformPkg: Fix Ecc error 10014 in LcdGraphicsOutputDxe
  2020-12-03 18:19 [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg PierreGondois
                   ` (8 preceding siblings ...)
  2020-12-03 18:19 ` [PATCH v1 09/16] ArmPlatformPkg: Fix Ecc error 10016 in LcdPlatformNullLib PierreGondois
@ 2020-12-03 18:19 ` PierreGondois
  2020-12-03 18:19 ` [PATCH v1 11/16] ArmPlatformPkg: Fix Ecc error 10014 in PL061GpioDxe PierreGondois
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: PierreGondois @ 2020-12-03 18:19 UTC (permalink / raw)
  To: leif, ard.biesheuvel, thomas.abraham, devel; +Cc: sami.mujawar

From: Pierre Gondois <Pierre.Gondois@arm.com>

This patch fixes the following Ecc reported error:
No used module files found

The source file
[ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h]
is existing in module directory but it is not described
in INF file.

Files in [Sources.common] are also alphabetically re-ordered.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 The changes can be seen at: https://github.com/PierreARM/edk2-platforms/tree/1537_Ecc_ArmPlatformPkg_v1

 ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf
index 27453b2656117ff015cd584787e8647820f59097..51bec36aed38e82449e6ba01165a6c60663318ae 100644
--- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf
+++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf
@@ -2,7 +2,7 @@
 #
 #  Component description file for LcdGraphicsOutputDxe module
 #
-#  Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>
+#  Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -17,8 +17,9 @@ [Defines]
   ENTRY_POINT                    = LcdGraphicsOutputDxeInitialize

 [Sources.common]
-  LcdGraphicsOutputDxe.c
   LcdGraphicsOutputBlt.c
+  LcdGraphicsOutputDxe.c
+  LcdGraphicsOutputDxe.h

 [Packages]
   ArmPlatformPkg/ArmPlatformPkg.dec
--
2.17.1


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

* [PATCH v1 11/16] ArmPlatformPkg: Fix Ecc error 10014 in PL061GpioDxe
  2020-12-03 18:19 [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg PierreGondois
                   ` (9 preceding siblings ...)
  2020-12-03 18:19 ` [PATCH v1 10/16] ArmPlatformPkg: Fix Ecc error 10014 in LcdGraphicsOutputDxe PierreGondois
@ 2020-12-03 18:19 ` PierreGondois
  2020-12-03 18:19 ` [PATCH v1 12/16] ArmPlatformPkg: Fix Ecc error 10014 in SP805WatchdogDxe PierreGondois
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: PierreGondois @ 2020-12-03 18:19 UTC (permalink / raw)
  To: leif, ard.biesheuvel, thomas.abraham, devel; +Cc: sami.mujawar

From: Pierre Gondois <Pierre.Gondois@arm.com>

This patch fixes the following Ecc reported error:
No used module files found

The source file
[ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.h]
is existing in module directory but it is not described
in INF file.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 The changes can be seen at: https://github.com/PierreARM/edk2-platforms/tree/1537_Ecc_ArmPlatformPkg_v1

 ArmPlatformPkg/Drivers/PL061GpioDxe/PL061GpioDxe.inf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061GpioDxe.inf b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061GpioDxe.inf
index 132f09ce2bf64f9110f1fb8c850aebb5cd427076..9c598bb66c76b7b9b9ff973ae6e84cf08e575e50 100644
--- a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061GpioDxe.inf
+++ b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061GpioDxe.inf
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2011, ARM Limited. All rights reserved.
+*  Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -16,6 +16,7 @@ [Defines]
   ENTRY_POINT                    = PL061InstallProtocol
 [Sources.common]
   PL061Gpio.c
+  PL061Gpio.h

 [Packages]
   MdePkg/MdePkg.dec
--
2.17.1


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

* [PATCH v1 12/16] ArmPlatformPkg: Fix Ecc error 10014 in SP805WatchdogDxe
  2020-12-03 18:19 [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg PierreGondois
                   ` (10 preceding siblings ...)
  2020-12-03 18:19 ` [PATCH v1 11/16] ArmPlatformPkg: Fix Ecc error 10014 in PL061GpioDxe PierreGondois
@ 2020-12-03 18:19 ` PierreGondois
  2020-12-03 18:19 ` [PATCH v1 13/16] ArmPlatformPkg: Fix Ecc error 10006 in ArmPlatformPkg.dsc PierreGondois
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: PierreGondois @ 2020-12-03 18:19 UTC (permalink / raw)
  To: leif, ard.biesheuvel, thomas.abraham, devel; +Cc: sami.mujawar

From: Pierre Gondois <Pierre.Gondois@arm.com>

This patch fixes the following Ecc reported error:
No used module files found

The source file
[ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.h]
is existing in module directory but it is not described
in INF file.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 The changes can be seen at: https://github.com/PierreARM/edk2-platforms/tree/1537_Ecc_ArmPlatformPkg_v1

 ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf b/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf
index 048f6697e93d702c5ec878ccc827e64e583893ea..fa87d92359ac4c62a6b72258b1e307e81e19f512 100644
--- a/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf
+++ b/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2011-2012, ARM Limited. All rights reserved.
+*  Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
 *  Copyright (c) 2018, Linaro Limited. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -17,6 +17,7 @@ [Defines]

 [Sources.common]
   SP805Watchdog.c
+  SP805Watchdog.h

 [Packages]
   ArmPkg/ArmPkg.dec
--
2.17.1


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

* [PATCH v1 13/16] ArmPlatformPkg: Fix Ecc error 10006 in ArmPlatformPkg.dsc
  2020-12-03 18:19 [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg PierreGondois
                   ` (11 preceding siblings ...)
  2020-12-03 18:19 ` [PATCH v1 12/16] ArmPlatformPkg: Fix Ecc error 10014 in SP805WatchdogDxe PierreGondois
@ 2020-12-03 18:19 ` PierreGondois
  2020-12-03 18:19 ` [PATCH v1 14/16] ArmPlatformPkg: Fix Ecc error 8001 in PrePi PierreGondois
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: PierreGondois @ 2020-12-03 18:19 UTC (permalink / raw)
  To: leif, ard.biesheuvel, thomas.abraham, devel; +Cc: sami.mujawar

From: Pierre Gondois <Pierre.Gondois@arm.com>

This patch fixes the following Ecc reported error:
There should be no unnecessary inclusion of library
classes in the INF file

This comes with the additional information:
"The Library Class [TimeBaseLib] is not used
in any platform"
"The Library Class [PL011UartClockLib] is not used
in any platform"
"The Library Class [PL011UartLib] is not used
in any platform"

Indeed, the PL011SerialPortLib module requires the
PL011UartClockLib and PL011UartLib libraries.
The PL031RealTimeClockLib module requires the TimeBaseLib
library.
ArmPlatformPkg/ArmPlatformPkg.dsc builds the two modules,
but doesn't build the required libraries. This patch adds
the missing libraries to the [LibraryClasses.common] section.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 The changes can be seen at: https://github.com/PierreARM/edk2-platforms/tree/1537_Ecc_ArmPlatformPkg_v1

 ArmPlatformPkg/ArmPlatformPkg.dsc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ArmPlatformPkg/ArmPlatformPkg.dsc b/ArmPlatformPkg/ArmPlatformPkg.dsc
index 5381c95af245e155e94adb315d4cd851a737c0a2..877b12b3b430393e1d8031bf2611c82e0785f2a6 100644
--- a/ArmPlatformPkg/ArmPlatformPkg.dsc
+++ b/ArmPlatformPkg/ArmPlatformPkg.dsc
@@ -2,7 +2,7 @@
 # ARM platform package.
 #
 # Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
-# Copyright (c) 2011 - 2018, ARM Ltd. All rights reserved.<BR>
+# Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
 # Copyright (c) 2016 - 2017, Linaro Ltd. All rights reserved.<BR>
 # Copyright (c) Microsoft Corporation.<BR>
 #
@@ -58,10 +58,13 @@ [LibraryClasses.common]
   PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
   PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
   PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
+  PL011UartClockLib|ArmPlatformPkg/Library/PL011UartClockLib/PL011UartClockLib.inf
+  PL011UartLib|ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf
   PlatformPeiLib|ArmPlatformPkg/PlatformPei/PlatformPeiLib.inf
   PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf
   PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
   SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
+  TimeBaseLib|EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf
   TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
   UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
   UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
--
2.17.1


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

* [PATCH v1 14/16] ArmPlatformPkg: Fix Ecc error 8001 in PrePi
  2020-12-03 18:19 [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg PierreGondois
                   ` (12 preceding siblings ...)
  2020-12-03 18:19 ` [PATCH v1 13/16] ArmPlatformPkg: Fix Ecc error 10006 in ArmPlatformPkg.dsc PierreGondois
@ 2020-12-03 18:19 ` PierreGondois
  2020-12-03 18:19 ` [PATCH v1 15/16] ArmPlatformPkg: Fix Ecc error 8005 PierreGondois
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 19+ messages in thread
From: PierreGondois @ 2020-12-03 18:19 UTC (permalink / raw)
  To: leif, ard.biesheuvel, thomas.abraham, devel; +Cc: sami.mujawar

From: Pierre Gondois <Pierre.Gondois@arm.com>

This patch fixes the following Ecc reported error:
Only capital letters are allowed to be used for #define
declarations

The "SerialPrint" macro is definied for the PrePi module
residing in the ArmPlatformPkg. It is never used in the module.
The macro is thus removed.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 The changes can be seen at: https://github.com/PierreARM/edk2-platforms/tree/1537_Ecc_ArmPlatformPkg_v1

 ArmPlatformPkg/PrePi/PrePi.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/ArmPlatformPkg/PrePi/PrePi.h b/ArmPlatformPkg/PrePi/PrePi.h
index b64dd764a435579db23532fa59f99a2dab7e3a34..2dce8c83024ec8301d294f12f10b4ea6d2b7a61a 100644
--- a/ArmPlatformPkg/PrePi/PrePi.h
+++ b/ArmPlatformPkg/PrePi/PrePi.h
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
+*  Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -21,8 +21,6 @@
 #include <Library/SerialPortLib.h>
 #include <Library/ArmPlatformLib.h>

-#define SerialPrint(txt)  SerialPortWrite (txt, AsciiStrLen(txt)+1);
-
 extern UINT64 mSystemMemoryEnd;

 RETURN_STATUS
--
2.17.1


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

* [PATCH v1 15/16] ArmPlatformPkg: Fix Ecc error 8005
  2020-12-03 18:19 [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg PierreGondois
                   ` (13 preceding siblings ...)
  2020-12-03 18:19 ` [PATCH v1 14/16] ArmPlatformPkg: Fix Ecc error 8001 in PrePi PierreGondois
@ 2020-12-03 18:19 ` PierreGondois
  2020-12-09 15:09   ` Ard Biesheuvel
  2020-12-03 18:19 ` [PATCH v1 16/16] ArmPlatformPkg: Fix cspell reported spelling/wording PierreGondois
  2020-12-09 15:33 ` [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg Ard Biesheuvel
  16 siblings, 1 reply; 19+ messages in thread
From: PierreGondois @ 2020-12-03 18:19 UTC (permalink / raw)
  To: leif, ard.biesheuvel, thomas.abraham, devel; +Cc: sami.mujawar

From: Pierre Gondois <Pierre.Gondois@arm.com>

This patch fixes the following Ecc reported error:
Variable name does not follow the rules:
1. First character should be upper case
2. Must contain lower case characters
3. No white space characters
4. Global variable name must start with a 'g'

Indeed, according to the EDK II C Coding Standards
Specification, s5.6.2.2 "Enumerated Types" and
s4.3.4 Function and Data Names, elements of an
enumerated type shoud be a mixed upper- and
lower-case text.

A max element is also added, as adviced by
s5.6.2.2.3 of the same document.

Reference:
https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 The changes can be seen at: https://github.com/PierreARM/edk2-platforms/tree/1537_Ecc_ArmPlatformPkg_v1

 ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputBlt.c | 88 ++++++++++----------
 ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c | 20 ++---
 ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h |  4 +-
 ArmPlatformPkg/Include/Library/LcdPlatformLib.h                    | 21 ++---
 ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.c     |  4 +-
 ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c                         |  4 +-
 6 files changed, 71 insertions(+), 70 deletions(-)

diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputBlt.c b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputBlt.c
index 07d2cb0d5dec0f85219fe5cdc438e18ae3a32a38..30b93900d223f550dab50741e7ad8e5442bac245 100644
--- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputBlt.c
+++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputBlt.c
@@ -61,7 +61,7 @@ VideoCopyNoHorizontalOverlap (

   switch (BitsPerPixel) {

-  case LCD_BITS_PER_PIXEL_24:
+  case ELcdBitsPerPixel_24:

     WidthInBytes = Width * 4;

@@ -79,9 +79,9 @@ VideoCopyNoHorizontalOverlap (
     }
     break;

-  case LCD_BITS_PER_PIXEL_16_555:
-  case LCD_BITS_PER_PIXEL_16_565:
-  case LCD_BITS_PER_PIXEL_12_444:
+  case ELcdBitsPerPixel_16_555:
+  case ELcdBitsPerPixel_16_565:
+  case ELcdBitsPerPixel_12_444:

     WidthInBytes = Width * 2;

@@ -99,10 +99,10 @@ VideoCopyNoHorizontalOverlap (
     }
     break;

-  case LCD_BITS_PER_PIXEL_8:
-  case LCD_BITS_PER_PIXEL_4:
-  case LCD_BITS_PER_PIXEL_2:
-  case LCD_BITS_PER_PIXEL_1:
+  case ELcdBitsPerPixel_8:
+  case ELcdBitsPerPixel_4:
+  case ELcdBitsPerPixel_2:
+  case ELcdBitsPerPixel_1:
   default:
     // Can't handle this case
     DEBUG((DEBUG_ERROR, "ArmVeGraphics_Blt: EfiBltVideoToVideo: INVALID Number of Bits Per Pixel: %d\n", BitsPerPixel));
@@ -149,7 +149,7 @@ VideoCopyHorizontalOverlap (

   switch (BitsPerPixel) {

-  case LCD_BITS_PER_PIXEL_24:
+  case ELcdBitsPerPixel_24:
     // Allocate a temporary buffer

     PixelBuffer32bit = (UINT32 *) AllocatePool((Height * Width) * sizeof(UINT32));
@@ -191,9 +191,9 @@ VideoCopyHorizontalOverlap (
     break;


-  case LCD_BITS_PER_PIXEL_16_555:
-  case LCD_BITS_PER_PIXEL_16_565:
-  case LCD_BITS_PER_PIXEL_12_444:
+  case ELcdBitsPerPixel_16_555:
+  case ELcdBitsPerPixel_16_565:
+  case ELcdBitsPerPixel_12_444:
     // Allocate a temporary buffer
     PixelBuffer16bit = (UINT16 *) AllocatePool((Height * Width) * sizeof(UINT16));

@@ -236,10 +236,10 @@ VideoCopyHorizontalOverlap (
     break;


-  case LCD_BITS_PER_PIXEL_8:
-  case LCD_BITS_PER_PIXEL_4:
-  case LCD_BITS_PER_PIXEL_2:
-  case LCD_BITS_PER_PIXEL_1:
+  case ELcdBitsPerPixel_8:
+  case ELcdBitsPerPixel_4:
+  case ELcdBitsPerPixel_2:
+  case ELcdBitsPerPixel_1:
   default:
     // Can't handle this case
     DEBUG((DEBUG_ERROR, "ArmVeGraphics_Blt: EfiBltVideoToVideo: INVALID Number of Bits Per Pixel: %d\n", BitsPerPixel));
@@ -270,7 +270,7 @@ BltVideoFill (
   EFI_PIXEL_BITMASK*  PixelInformation;
   EFI_STATUS         Status;
   UINT32             HorizontalResolution;
-  LCD_BPP            BitsPerPixel;
+  ELCD_BPP           BitsPerPixel;
   VOID            *FrameBufferBase;
   VOID            *DestinationAddr;
   UINT16          *DestinationPixel16bit;
@@ -287,7 +287,7 @@ BltVideoFill (
   LcdPlatformGetBpp (This->Mode->Mode,&BitsPerPixel);

   switch (BitsPerPixel) {
-  case LCD_BITS_PER_PIXEL_24:
+  case ELcdBitsPerPixel_24:
     WidthInBytes = Width * 4;

     // Copy the SourcePixel into every pixel inside the target rectangle
@@ -303,7 +303,7 @@ BltVideoFill (
     }
     break;

-  case LCD_BITS_PER_PIXEL_16_555:
+  case ELcdBitsPerPixel_16_555:
     // Convert the EFI pixel at the start of the BltBuffer(0,0) into a video display pixel
     Pixel16bit = (UINT16) (
         ( (EfiSourcePixel->Red      <<  7) & PixelInformation->RedMask      )
@@ -330,7 +330,7 @@ BltVideoFill (
     }
     break;

-  case LCD_BITS_PER_PIXEL_16_565:
+  case ELcdBitsPerPixel_16_565:
     // Convert the EFI pixel at the start of the BltBuffer(0,0) into a video display pixel
     Pixel16bit = (UINT16) (
         ( (EfiSourcePixel->Red      <<  8) & PixelInformation->RedMask      )
@@ -356,7 +356,7 @@ BltVideoFill (
     }
     break;

-  case LCD_BITS_PER_PIXEL_12_444:
+  case ELcdBitsPerPixel_12_444:
     // Convert the EFI pixel at the start of the BltBuffer(0,0) into a video display pixel
     Pixel16bit = (UINT16) (
         ( (EfiSourcePixel->Red      >> 4) & PixelInformation->RedMask      )
@@ -382,10 +382,10 @@ BltVideoFill (
     }
     break;

-  case LCD_BITS_PER_PIXEL_8:
-  case LCD_BITS_PER_PIXEL_4:
-  case LCD_BITS_PER_PIXEL_2:
-  case LCD_BITS_PER_PIXEL_1:
+  case ELcdBitsPerPixel_8:
+  case ELcdBitsPerPixel_4:
+  case ELcdBitsPerPixel_2:
+  case ELcdBitsPerPixel_1:
   default:
     // Can't handle this case
     DEBUG((DEBUG_ERROR, "LcdGraphicsBlt: EfiBltVideoFill: INVALID Number of Bits Per Pixel: %d\n", BitsPerPixel));
@@ -412,7 +412,7 @@ BltVideoToBltBuffer (
 {
   EFI_STATUS         Status;
   UINT32             HorizontalResolution;
-  LCD_BPP            BitsPerPixel;
+  ELCD_BPP           BitsPerPixel;
   EFI_PIXEL_BITMASK  *PixelInformation;
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL *EfiDestinationPixel;
   VOID   *FrameBufferBase;
@@ -443,7 +443,7 @@ BltVideoToBltBuffer (
   LcdPlatformGetBpp (This->Mode->Mode,&BitsPerPixel);

   switch (BitsPerPixel) {
-  case LCD_BITS_PER_PIXEL_24:
+  case ELcdBitsPerPixel_24:
     WidthInBytes = Width * 4;

     // Access each line inside the Video Memory
@@ -460,7 +460,7 @@ BltVideoToBltBuffer (
     }
     break;

-  case LCD_BITS_PER_PIXEL_16_555:
+  case ELcdBitsPerPixel_16_555:
     // Access each pixel inside the Video Memory
     for (SourceLine = SourceY, DestinationLine = DestinationY;
          SourceLine < SourceY + Height;
@@ -487,7 +487,7 @@ BltVideoToBltBuffer (
     }
     break;

-  case LCD_BITS_PER_PIXEL_16_565:
+  case ELcdBitsPerPixel_16_565:
     // Access each pixel inside the Video Memory
     for (SourceLine = SourceY, DestinationLine = DestinationY;
          SourceLine < SourceY + Height;
@@ -515,7 +515,7 @@ BltVideoToBltBuffer (
     }
     break;

-  case LCD_BITS_PER_PIXEL_12_444:
+  case ELcdBitsPerPixel_12_444:
     // Access each pixel inside the Video Memory
     for (SourceLine = SourceY, DestinationLine = DestinationY;
          SourceLine < SourceY + Height;
@@ -542,10 +542,10 @@ BltVideoToBltBuffer (
     }
     break;

-  case LCD_BITS_PER_PIXEL_8:
-  case LCD_BITS_PER_PIXEL_4:
-  case LCD_BITS_PER_PIXEL_2:
-  case LCD_BITS_PER_PIXEL_1:
+  case ELcdBitsPerPixel_8:
+  case ELcdBitsPerPixel_4:
+  case ELcdBitsPerPixel_2:
+  case ELcdBitsPerPixel_1:
   default:
     // Can't handle this case
     DEBUG((DEBUG_ERROR, "LcdGraphicsBlt: EfiBltVideoToBltBuffer: INVALID Number of Bits Per Pixel: %d\n", BitsPerPixel));
@@ -571,7 +571,7 @@ BltBufferToVideo (
 {
   EFI_STATUS         Status;
   UINT32             HorizontalResolution;
-  LCD_BPP            BitsPerPixel;
+  ELCD_BPP           BitsPerPixel;
   EFI_PIXEL_BITMASK  *PixelInformation;
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL *EfiSourcePixel;
   VOID   *FrameBufferBase;
@@ -601,7 +601,7 @@ BltBufferToVideo (
   LcdPlatformGetBpp (This->Mode->Mode,&BitsPerPixel);

   switch (BitsPerPixel) {
-  case LCD_BITS_PER_PIXEL_24:
+  case ELcdBitsPerPixel_24:
     WidthInBytes = Width * 4;

     // Access each pixel inside the BltBuffer Memory
@@ -618,7 +618,7 @@ BltBufferToVideo (
     }
     break;

-  case LCD_BITS_PER_PIXEL_16_555:
+  case ELcdBitsPerPixel_16_555:
     // Access each pixel inside the BltBuffer Memory
     for (SourceLine = SourceY, DestinationLine = DestinationY;
        SourceLine < SourceY + Height;
@@ -645,7 +645,7 @@ BltBufferToVideo (
     }
     break;

-  case LCD_BITS_PER_PIXEL_16_565:
+  case ELcdBitsPerPixel_16_565:
     // Access each pixel inside the BltBuffer Memory
     for (SourceLine = SourceY, DestinationLine = DestinationY;
          SourceLine < SourceY + Height;
@@ -672,7 +672,7 @@ BltBufferToVideo (
     }
     break;

-  case LCD_BITS_PER_PIXEL_12_444:
+  case ELcdBitsPerPixel_12_444:
     // Access each pixel inside the BltBuffer Memory
     for (SourceLine = SourceY, DestinationLine = DestinationY;
          SourceLine < SourceY + Height;
@@ -699,10 +699,10 @@ BltBufferToVideo (
     }
     break;

-  case LCD_BITS_PER_PIXEL_8:
-  case LCD_BITS_PER_PIXEL_4:
-  case LCD_BITS_PER_PIXEL_2:
-  case LCD_BITS_PER_PIXEL_1:
+  case ELcdBitsPerPixel_8:
+  case ELcdBitsPerPixel_4:
+  case ELcdBitsPerPixel_2:
+  case ELcdBitsPerPixel_1:
   default:
     // Can't handle this case
     DEBUG((DEBUG_ERROR, "LcdGraphicsBlt: EfiBltBufferToVideo: INVALID Number of Bits Per Pixel: %d\n", BitsPerPixel));
@@ -728,7 +728,7 @@ BltVideoToVideo (
 {
   EFI_STATUS         Status;
   UINT32             HorizontalResolution;
-  LCD_BPP            BitsPerPixel;
+  ELCD_BPP           BitsPerPixel;
   VOID   *FrameBufferBase;

   HorizontalResolution = This->Mode->Info->HorizontalResolution;
diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c
index bfd03d8f84258158e76690cc5a0d9333f11d67f0..d85a3830355d6d091c94c1fa33ced4f8a6313947 100644
--- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c
+++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c
@@ -299,7 +299,7 @@ LcdGraphicsSetMode (
   EFI_STATUS                      Status;
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL   FillColour;
   LCD_INSTANCE*                   Instance;
-  LCD_BPP                         Bpp;
+  ELCD_BPP                        Bpp;

   Instance = LCD_INSTANCE_FROM_GOP_THIS (This);

@@ -370,22 +370,22 @@ EXIT:

 UINTN
 GetBytesPerPixel (
-  IN  LCD_BPP       Bpp
+  IN  ELCD_BPP      Bpp
   )
 {
   switch (Bpp) {
-  case LCD_BITS_PER_PIXEL_24:
+  case ELcdBitsPerPixel_24:
     return 4;

-  case LCD_BITS_PER_PIXEL_16_565:
-  case LCD_BITS_PER_PIXEL_16_555:
-  case LCD_BITS_PER_PIXEL_12_444:
+  case ELcdBitsPerPixel_16_565:
+  case ELcdBitsPerPixel_16_555:
+  case ELcdBitsPerPixel_12_444:
     return 2;

-  case LCD_BITS_PER_PIXEL_8:
-  case LCD_BITS_PER_PIXEL_4:
-  case LCD_BITS_PER_PIXEL_2:
-  case LCD_BITS_PER_PIXEL_1:
+  case ELcdBitsPerPixel_8:
+  case ELcdBitsPerPixel_4:
+  case ELcdBitsPerPixel_2:
+  case ELcdBitsPerPixel_1:
     return 1;

   default:
diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h
index c49afd3b058f2d2b3c91b1a2d4446a8fcde5202d..6a64fc2bb9dfb10b7d9ca9e4c34cc33a83ff08e6 100644
--- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h
+++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h
@@ -1,6 +1,6 @@
 /** @file

-  Copyright (c) 2011-2018, ARM Ltd. All rights reserved.<BR>
+  Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent

 **/
@@ -83,7 +83,7 @@ LcdGraphicsBlt (

 UINTN
 GetBytesPerPixel (
-  IN  LCD_BPP       Bpp
+  IN  ELCD_BPP      Bpp
   );

 EFI_STATUS
diff --git a/ArmPlatformPkg/Include/Library/LcdPlatformLib.h b/ArmPlatformPkg/Include/Library/LcdPlatformLib.h
index ba24487073bb32296104270d78b0e1928193c9e8..eecf2920537d951feb6c76a51f8d66854806acbc 100644
--- a/ArmPlatformPkg/Include/Library/LcdPlatformLib.h
+++ b/ArmPlatformPkg/Include/Library/LcdPlatformLib.h
@@ -197,15 +197,16 @@
   Register
 **/
 typedef enum {
-  LCD_BITS_PER_PIXEL_1 = 0,
-  LCD_BITS_PER_PIXEL_2,
-  LCD_BITS_PER_PIXEL_4,
-  LCD_BITS_PER_PIXEL_8,
-  LCD_BITS_PER_PIXEL_16_555,
-  LCD_BITS_PER_PIXEL_24,
-  LCD_BITS_PER_PIXEL_16_565,
-  LCD_BITS_PER_PIXEL_12_444
-} LCD_BPP;
+  ELcdBitsPerPixel_1 = 0,
+  ELcdBitsPerPixel_2,
+  ELcdBitsPerPixel_4,
+  ELcdBitsPerPixel_8,
+  ELcdBitsPerPixel_16_555,
+  ELcdBitsPerPixel_24,
+  ELcdBitsPerPixel_16_565,
+  ELcdBitsPerPixel_12_444,
+  ELcdBitsPerPixel_Max
+} ELCD_BPP;

 // Display timing settings.
 typedef struct {
@@ -320,7 +321,7 @@ LcdPlatformGetTimings (
 EFI_STATUS
 LcdPlatformGetBpp (
   IN  UINT32                                ModeNumber,
-  OUT LCD_BPP*                              Bpp
+  OUT ELCD_BPP*                             Bpp
   );

 #endif /* LCD_PLATFORM_LIB_H_ */
diff --git a/ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.c b/ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.c
index dca3cf706ee12e2c1e1545e43b862ea87e16395b..ca80eeb83993cfdce6d2428b94b9b8163f0e55ad 100644
--- a/ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.c
+++ b/ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.c
@@ -1,7 +1,7 @@
 /** @file

   Copyright (c) 2017, Linaro, Ltd. All rights reserved.
-  Copyright (c) 2018, Arm Limited. All rights reserved.
+  Copyright (c) 2018 - 2020, Arm Limited. All rights reserved.<BR>

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -137,7 +137,7 @@ LcdPlatformGetTimings (
 EFI_STATUS
 LcdPlatformGetBpp (
   IN  UINT32                                ModeNumber,
-  OUT LCD_BPP*                              Bpp
+  OUT ELCD_BPP*                             Bpp
   )
 {
   ASSERT (FALSE);
diff --git a/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c b/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c
index 05b6f8974f12fafd53cdff2314d33f9c93d79670..ace6c5eb3cbbaa784c5d1f40ee3b372551d83820 100644
--- a/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c
+++ b/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c
@@ -1,7 +1,7 @@
 /** @file
   This file contains the platform independent parts of PL111Lcd

-  Copyright (c) 2011-2018, ARM Ltd. All rights reserved.<BR>
+  Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -80,7 +80,7 @@ LcdSetMode (
   SCAN_TIMINGS      *Horizontal;
   SCAN_TIMINGS      *Vertical;
   UINT32            LcdControl;
-  LCD_BPP           LcdBpp;
+  ELCD_BPP          LcdBpp;

   EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  ModeInfo;

--
2.17.1


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

* [PATCH v1 16/16] ArmPlatformPkg: Fix cspell reported spelling/wording
  2020-12-03 18:19 [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg PierreGondois
                   ` (14 preceding siblings ...)
  2020-12-03 18:19 ` [PATCH v1 15/16] ArmPlatformPkg: Fix Ecc error 8005 PierreGondois
@ 2020-12-03 18:19 ` PierreGondois
  2020-12-09 15:33 ` [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg Ard Biesheuvel
  16 siblings, 0 replies; 19+ messages in thread
From: PierreGondois @ 2020-12-03 18:19 UTC (permalink / raw)
  To: leif, ard.biesheuvel, thomas.abraham, devel; +Cc: sami.mujawar

From: Pierre Gondois <Pierre.Gondois@arm.com>

The edk2 CI runs the "cspell" spell checker tool. Some words
are not recognized by the tool, triggering errors.
This patch modifies some spelling/wording detected by cspell.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
---
 The changes can be seen at: https://github.com/PierreARM/edk2-platforms/tree/1537_Ecc_ArmPlatformPkg_v1

 ArmPlatformPkg/ArmPlatformPkg.dsc               | 4 ++--
 ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S | 4 ++--
 ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.S     | 4 ++--
 ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.asm   | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/ArmPlatformPkg/ArmPlatformPkg.dsc b/ArmPlatformPkg/ArmPlatformPkg.dsc
index 877b12b3b430393e1d8031bf2611c82e0785f2a6..b92ef712be870168c3097e20d2b88070553ab175 100644
--- a/ArmPlatformPkg/ArmPlatformPkg.dsc
+++ b/ArmPlatformPkg/ArmPlatformPkg.dsc
@@ -26,8 +26,8 @@ [Defines]
   SKUID_IDENTIFIER               = DEFAULT

 [BuildOptions]
-  RELEASE_*_*_CC_FLAGS  = -DMDEPKG_NDEBUG
-  *_*_*_CC_FLAGS  = -DDISABLE_NEW_DEPRECATED_INTERFACES
+  RELEASE_*_*_CC_FLAGS  = -D MDEPKG_NDEBUG
+  *_*_*_CC_FLAGS  = -D DISABLE_NEW_DEPRECATED_INTERFACES

 [PcdsFixedAtBuild]
   gArmTokenSpaceGuid.PcdFdBaseAddress|0x0
diff --git a/ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S b/ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S
index 4929ca42edcede492b1303ccd05a9bb0d4b06ccb..e3aa546897cb0c2131edd352f0875f43d91ba86e 100644
--- a/ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S
+++ b/ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S
@@ -1,5 +1,5 @@
 //
-//  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
+//  Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
 //
 //  SPDX-License-Identifier: BSD-2-Clause-Patent
 //
@@ -11,7 +11,7 @@ ASM_FUNC(_ModuleEntryPoint)
   // Do early platform specific actions
   bl    ASM_PFX(ArmPlatformPeiBootAction)

-  // Get ID of this CPU in Multicore system
+  // Get ID of this CPU in multi-core system
   bl    ASM_PFX(ArmReadMpidr)
   // Keep a copy of the MpId register value
   mov   x10, x0
diff --git a/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.S b/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.S
index ff7e3a4548539d80b5dc94e6688dfde8dd0b8c8f..6709dad0b9d1a75b505c88a8bb59c7000f622f8f 100644
--- a/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.S
+++ b/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.S
@@ -1,5 +1,5 @@
 //
-//  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
+//  Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
 //
 //  SPDX-License-Identifier: BSD-2-Clause-Patent
 //
@@ -13,7 +13,7 @@ ASM_FUNC(_ModuleEntryPoint)
   // Do early platform specific actions
   bl    ASM_PFX(ArmPlatformPeiBootAction)

-  // Get ID of this CPU in Multicore system
+  // Get ID of this CPU in multi-core system
   bl    ASM_PFX(ArmReadMpidr)
   // Keep a copy of the MpId register value
   mov   r8, r0
diff --git a/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.asm b/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.asm
index 3da789205124525b9278dc49b92af6f30573cf16..eaba90cc3d7c329a40d3d80c17a0e5132aeccd77 100644
--- a/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.asm
+++ b/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.asm
@@ -1,5 +1,5 @@
 //
-//  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
+//  Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
 //
 //  SPDX-License-Identifier: BSD-2-Clause-Patent
 //
@@ -28,7 +28,7 @@ _ModuleEntryPoint
   // Do early platform specific actions
   bl    ArmPlatformPeiBootAction

-  // Get ID of this CPU in Multicore system
+  // Get ID of this CPU in multi-core system
   bl    ArmReadMpidr
   // Keep a copy of the MpId register value
   mov   r8, r0
--
2.17.1


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

* Re: [PATCH v1 15/16] ArmPlatformPkg: Fix Ecc error 8005
  2020-12-03 18:19 ` [PATCH v1 15/16] ArmPlatformPkg: Fix Ecc error 8005 PierreGondois
@ 2020-12-09 15:09   ` Ard Biesheuvel
  0 siblings, 0 replies; 19+ messages in thread
From: Ard Biesheuvel @ 2020-12-09 15:09 UTC (permalink / raw)
  To: Pierre.Gondois, leif, thomas.abraham, devel; +Cc: sami.mujawar

On 12/3/20 7:19 PM, Pierre.Gondois@arm.com wrote:
> From: Pierre Gondois <Pierre.Gondois@arm.com>
> 
> This patch fixes the following Ecc reported error:
> Variable name does not follow the rules:
> 1. First character should be upper case
> 2. Must contain lower case characters
> 3. No white space characters
> 4. Global variable name must start with a 'g'
> 
> Indeed, according to the EDK II C Coding Standards
> Specification, s5.6.2.2 "Enumerated Types" and
> s4.3.4 Function and Data Names, elements of an
> enumerated type shoud be a mixed upper- and
> lower-case text.
> 
> A max element is also added, as adviced by
> s5.6.2.2.3 of the same document.
> 
> Reference:
> https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/
> 
> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>

Hello Pierre,

I take it the E... prefix is for Enum? I don't think we need that - most
enum typedef just use CamelCase identifiers here.




> ---
>  The changes can be seen at: https://github.com/PierreARM/edk2-platforms/tree/1537_Ecc_ArmPlatformPkg_v1
> 
>  ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputBlt.c | 88 ++++++++++----------
>  ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c | 20 ++---
>  ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h |  4 +-
>  ArmPlatformPkg/Include/Library/LcdPlatformLib.h                    | 21 ++---
>  ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.c     |  4 +-
>  ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c                         |  4 +-
>  6 files changed, 71 insertions(+), 70 deletions(-)
> 
> diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputBlt.c b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputBlt.c
> index 07d2cb0d5dec0f85219fe5cdc438e18ae3a32a38..30b93900d223f550dab50741e7ad8e5442bac245 100644
> --- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputBlt.c
> +++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputBlt.c
> @@ -61,7 +61,7 @@ VideoCopyNoHorizontalOverlap (
> 
>    switch (BitsPerPixel) {
> 
> -  case LCD_BITS_PER_PIXEL_24:
> +  case ELcdBitsPerPixel_24:
> 
>      WidthInBytes = Width * 4;
> 
> @@ -79,9 +79,9 @@ VideoCopyNoHorizontalOverlap (
>      }
>      break;
> 
> -  case LCD_BITS_PER_PIXEL_16_555:
> -  case LCD_BITS_PER_PIXEL_16_565:
> -  case LCD_BITS_PER_PIXEL_12_444:
> +  case ELcdBitsPerPixel_16_555:
> +  case ELcdBitsPerPixel_16_565:
> +  case ELcdBitsPerPixel_12_444:
> 
>      WidthInBytes = Width * 2;
> 
> @@ -99,10 +99,10 @@ VideoCopyNoHorizontalOverlap (
>      }
>      break;
> 
> -  case LCD_BITS_PER_PIXEL_8:
> -  case LCD_BITS_PER_PIXEL_4:
> -  case LCD_BITS_PER_PIXEL_2:
> -  case LCD_BITS_PER_PIXEL_1:
> +  case ELcdBitsPerPixel_8:
> +  case ELcdBitsPerPixel_4:
> +  case ELcdBitsPerPixel_2:
> +  case ELcdBitsPerPixel_1:
>    default:
>      // Can't handle this case
>      DEBUG((DEBUG_ERROR, "ArmVeGraphics_Blt: EfiBltVideoToVideo: INVALID Number of Bits Per Pixel: %d\n", BitsPerPixel));
> @@ -149,7 +149,7 @@ VideoCopyHorizontalOverlap (
> 
>    switch (BitsPerPixel) {
> 
> -  case LCD_BITS_PER_PIXEL_24:
> +  case ELcdBitsPerPixel_24:
>      // Allocate a temporary buffer
> 
>      PixelBuffer32bit = (UINT32 *) AllocatePool((Height * Width) * sizeof(UINT32));
> @@ -191,9 +191,9 @@ VideoCopyHorizontalOverlap (
>      break;
> 
> 
> -  case LCD_BITS_PER_PIXEL_16_555:
> -  case LCD_BITS_PER_PIXEL_16_565:
> -  case LCD_BITS_PER_PIXEL_12_444:
> +  case ELcdBitsPerPixel_16_555:
> +  case ELcdBitsPerPixel_16_565:
> +  case ELcdBitsPerPixel_12_444:
>      // Allocate a temporary buffer
>      PixelBuffer16bit = (UINT16 *) AllocatePool((Height * Width) * sizeof(UINT16));
> 
> @@ -236,10 +236,10 @@ VideoCopyHorizontalOverlap (
>      break;
> 
> 
> -  case LCD_BITS_PER_PIXEL_8:
> -  case LCD_BITS_PER_PIXEL_4:
> -  case LCD_BITS_PER_PIXEL_2:
> -  case LCD_BITS_PER_PIXEL_1:
> +  case ELcdBitsPerPixel_8:
> +  case ELcdBitsPerPixel_4:
> +  case ELcdBitsPerPixel_2:
> +  case ELcdBitsPerPixel_1:
>    default:
>      // Can't handle this case
>      DEBUG((DEBUG_ERROR, "ArmVeGraphics_Blt: EfiBltVideoToVideo: INVALID Number of Bits Per Pixel: %d\n", BitsPerPixel));
> @@ -270,7 +270,7 @@ BltVideoFill (
>    EFI_PIXEL_BITMASK*  PixelInformation;
>    EFI_STATUS         Status;
>    UINT32             HorizontalResolution;
> -  LCD_BPP            BitsPerPixel;
> +  ELCD_BPP           BitsPerPixel;
>    VOID            *FrameBufferBase;
>    VOID            *DestinationAddr;
>    UINT16          *DestinationPixel16bit;
> @@ -287,7 +287,7 @@ BltVideoFill (
>    LcdPlatformGetBpp (This->Mode->Mode,&BitsPerPixel);
> 
>    switch (BitsPerPixel) {
> -  case LCD_BITS_PER_PIXEL_24:
> +  case ELcdBitsPerPixel_24:
>      WidthInBytes = Width * 4;
> 
>      // Copy the SourcePixel into every pixel inside the target rectangle
> @@ -303,7 +303,7 @@ BltVideoFill (
>      }
>      break;
> 
> -  case LCD_BITS_PER_PIXEL_16_555:
> +  case ELcdBitsPerPixel_16_555:
>      // Convert the EFI pixel at the start of the BltBuffer(0,0) into a video display pixel
>      Pixel16bit = (UINT16) (
>          ( (EfiSourcePixel->Red      <<  7) & PixelInformation->RedMask      )
> @@ -330,7 +330,7 @@ BltVideoFill (
>      }
>      break;
> 
> -  case LCD_BITS_PER_PIXEL_16_565:
> +  case ELcdBitsPerPixel_16_565:
>      // Convert the EFI pixel at the start of the BltBuffer(0,0) into a video display pixel
>      Pixel16bit = (UINT16) (
>          ( (EfiSourcePixel->Red      <<  8) & PixelInformation->RedMask      )
> @@ -356,7 +356,7 @@ BltVideoFill (
>      }
>      break;
> 
> -  case LCD_BITS_PER_PIXEL_12_444:
> +  case ELcdBitsPerPixel_12_444:
>      // Convert the EFI pixel at the start of the BltBuffer(0,0) into a video display pixel
>      Pixel16bit = (UINT16) (
>          ( (EfiSourcePixel->Red      >> 4) & PixelInformation->RedMask      )
> @@ -382,10 +382,10 @@ BltVideoFill (
>      }
>      break;
> 
> -  case LCD_BITS_PER_PIXEL_8:
> -  case LCD_BITS_PER_PIXEL_4:
> -  case LCD_BITS_PER_PIXEL_2:
> -  case LCD_BITS_PER_PIXEL_1:
> +  case ELcdBitsPerPixel_8:
> +  case ELcdBitsPerPixel_4:
> +  case ELcdBitsPerPixel_2:
> +  case ELcdBitsPerPixel_1:
>    default:
>      // Can't handle this case
>      DEBUG((DEBUG_ERROR, "LcdGraphicsBlt: EfiBltVideoFill: INVALID Number of Bits Per Pixel: %d\n", BitsPerPixel));
> @@ -412,7 +412,7 @@ BltVideoToBltBuffer (
>  {
>    EFI_STATUS         Status;
>    UINT32             HorizontalResolution;
> -  LCD_BPP            BitsPerPixel;
> +  ELCD_BPP           BitsPerPixel;
>    EFI_PIXEL_BITMASK  *PixelInformation;
>    EFI_GRAPHICS_OUTPUT_BLT_PIXEL *EfiDestinationPixel;
>    VOID   *FrameBufferBase;
> @@ -443,7 +443,7 @@ BltVideoToBltBuffer (
>    LcdPlatformGetBpp (This->Mode->Mode,&BitsPerPixel);
> 
>    switch (BitsPerPixel) {
> -  case LCD_BITS_PER_PIXEL_24:
> +  case ELcdBitsPerPixel_24:
>      WidthInBytes = Width * 4;
> 
>      // Access each line inside the Video Memory
> @@ -460,7 +460,7 @@ BltVideoToBltBuffer (
>      }
>      break;
> 
> -  case LCD_BITS_PER_PIXEL_16_555:
> +  case ELcdBitsPerPixel_16_555:
>      // Access each pixel inside the Video Memory
>      for (SourceLine = SourceY, DestinationLine = DestinationY;
>           SourceLine < SourceY + Height;
> @@ -487,7 +487,7 @@ BltVideoToBltBuffer (
>      }
>      break;
> 
> -  case LCD_BITS_PER_PIXEL_16_565:
> +  case ELcdBitsPerPixel_16_565:
>      // Access each pixel inside the Video Memory
>      for (SourceLine = SourceY, DestinationLine = DestinationY;
>           SourceLine < SourceY + Height;
> @@ -515,7 +515,7 @@ BltVideoToBltBuffer (
>      }
>      break;
> 
> -  case LCD_BITS_PER_PIXEL_12_444:
> +  case ELcdBitsPerPixel_12_444:
>      // Access each pixel inside the Video Memory
>      for (SourceLine = SourceY, DestinationLine = DestinationY;
>           SourceLine < SourceY + Height;
> @@ -542,10 +542,10 @@ BltVideoToBltBuffer (
>      }
>      break;
> 
> -  case LCD_BITS_PER_PIXEL_8:
> -  case LCD_BITS_PER_PIXEL_4:
> -  case LCD_BITS_PER_PIXEL_2:
> -  case LCD_BITS_PER_PIXEL_1:
> +  case ELcdBitsPerPixel_8:
> +  case ELcdBitsPerPixel_4:
> +  case ELcdBitsPerPixel_2:
> +  case ELcdBitsPerPixel_1:
>    default:
>      // Can't handle this case
>      DEBUG((DEBUG_ERROR, "LcdGraphicsBlt: EfiBltVideoToBltBuffer: INVALID Number of Bits Per Pixel: %d\n", BitsPerPixel));
> @@ -571,7 +571,7 @@ BltBufferToVideo (
>  {
>    EFI_STATUS         Status;
>    UINT32             HorizontalResolution;
> -  LCD_BPP            BitsPerPixel;
> +  ELCD_BPP           BitsPerPixel;
>    EFI_PIXEL_BITMASK  *PixelInformation;
>    EFI_GRAPHICS_OUTPUT_BLT_PIXEL *EfiSourcePixel;
>    VOID   *FrameBufferBase;
> @@ -601,7 +601,7 @@ BltBufferToVideo (
>    LcdPlatformGetBpp (This->Mode->Mode,&BitsPerPixel);
> 
>    switch (BitsPerPixel) {
> -  case LCD_BITS_PER_PIXEL_24:
> +  case ELcdBitsPerPixel_24:
>      WidthInBytes = Width * 4;
> 
>      // Access each pixel inside the BltBuffer Memory
> @@ -618,7 +618,7 @@ BltBufferToVideo (
>      }
>      break;
> 
> -  case LCD_BITS_PER_PIXEL_16_555:
> +  case ELcdBitsPerPixel_16_555:
>      // Access each pixel inside the BltBuffer Memory
>      for (SourceLine = SourceY, DestinationLine = DestinationY;
>         SourceLine < SourceY + Height;
> @@ -645,7 +645,7 @@ BltBufferToVideo (
>      }
>      break;
> 
> -  case LCD_BITS_PER_PIXEL_16_565:
> +  case ELcdBitsPerPixel_16_565:
>      // Access each pixel inside the BltBuffer Memory
>      for (SourceLine = SourceY, DestinationLine = DestinationY;
>           SourceLine < SourceY + Height;
> @@ -672,7 +672,7 @@ BltBufferToVideo (
>      }
>      break;
> 
> -  case LCD_BITS_PER_PIXEL_12_444:
> +  case ELcdBitsPerPixel_12_444:
>      // Access each pixel inside the BltBuffer Memory
>      for (SourceLine = SourceY, DestinationLine = DestinationY;
>           SourceLine < SourceY + Height;
> @@ -699,10 +699,10 @@ BltBufferToVideo (
>      }
>      break;
> 
> -  case LCD_BITS_PER_PIXEL_8:
> -  case LCD_BITS_PER_PIXEL_4:
> -  case LCD_BITS_PER_PIXEL_2:
> -  case LCD_BITS_PER_PIXEL_1:
> +  case ELcdBitsPerPixel_8:
> +  case ELcdBitsPerPixel_4:
> +  case ELcdBitsPerPixel_2:
> +  case ELcdBitsPerPixel_1:
>    default:
>      // Can't handle this case
>      DEBUG((DEBUG_ERROR, "LcdGraphicsBlt: EfiBltBufferToVideo: INVALID Number of Bits Per Pixel: %d\n", BitsPerPixel));
> @@ -728,7 +728,7 @@ BltVideoToVideo (
>  {
>    EFI_STATUS         Status;
>    UINT32             HorizontalResolution;
> -  LCD_BPP            BitsPerPixel;
> +  ELCD_BPP           BitsPerPixel;
>    VOID   *FrameBufferBase;
> 
>    HorizontalResolution = This->Mode->Info->HorizontalResolution;
> diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c
> index bfd03d8f84258158e76690cc5a0d9333f11d67f0..d85a3830355d6d091c94c1fa33ced4f8a6313947 100644
> --- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c
> +++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c
> @@ -299,7 +299,7 @@ LcdGraphicsSetMode (
>    EFI_STATUS                      Status;
>    EFI_GRAPHICS_OUTPUT_BLT_PIXEL   FillColour;
>    LCD_INSTANCE*                   Instance;
> -  LCD_BPP                         Bpp;
> +  ELCD_BPP                        Bpp;
> 
>    Instance = LCD_INSTANCE_FROM_GOP_THIS (This);
> 
> @@ -370,22 +370,22 @@ EXIT:
> 
>  UINTN
>  GetBytesPerPixel (
> -  IN  LCD_BPP       Bpp
> +  IN  ELCD_BPP      Bpp
>    )
>  {
>    switch (Bpp) {
> -  case LCD_BITS_PER_PIXEL_24:
> +  case ELcdBitsPerPixel_24:
>      return 4;
> 
> -  case LCD_BITS_PER_PIXEL_16_565:
> -  case LCD_BITS_PER_PIXEL_16_555:
> -  case LCD_BITS_PER_PIXEL_12_444:
> +  case ELcdBitsPerPixel_16_565:
> +  case ELcdBitsPerPixel_16_555:
> +  case ELcdBitsPerPixel_12_444:
>      return 2;
> 
> -  case LCD_BITS_PER_PIXEL_8:
> -  case LCD_BITS_PER_PIXEL_4:
> -  case LCD_BITS_PER_PIXEL_2:
> -  case LCD_BITS_PER_PIXEL_1:
> +  case ELcdBitsPerPixel_8:
> +  case ELcdBitsPerPixel_4:
> +  case ELcdBitsPerPixel_2:
> +  case ELcdBitsPerPixel_1:
>      return 1;
> 
>    default:
> diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h
> index c49afd3b058f2d2b3c91b1a2d4446a8fcde5202d..6a64fc2bb9dfb10b7d9ca9e4c34cc33a83ff08e6 100644
> --- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h
> +++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h
> @@ -1,6 +1,6 @@
>  /** @file
> 
> -  Copyright (c) 2011-2018, ARM Ltd. All rights reserved.<BR>
> +  Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
>    SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -83,7 +83,7 @@ LcdGraphicsBlt (
> 
>  UINTN
>  GetBytesPerPixel (
> -  IN  LCD_BPP       Bpp
> +  IN  ELCD_BPP      Bpp
>    );
> 
>  EFI_STATUS
> diff --git a/ArmPlatformPkg/Include/Library/LcdPlatformLib.h b/ArmPlatformPkg/Include/Library/LcdPlatformLib.h
> index ba24487073bb32296104270d78b0e1928193c9e8..eecf2920537d951feb6c76a51f8d66854806acbc 100644
> --- a/ArmPlatformPkg/Include/Library/LcdPlatformLib.h
> +++ b/ArmPlatformPkg/Include/Library/LcdPlatformLib.h
> @@ -197,15 +197,16 @@
>    Register
>  **/
>  typedef enum {
> -  LCD_BITS_PER_PIXEL_1 = 0,
> -  LCD_BITS_PER_PIXEL_2,
> -  LCD_BITS_PER_PIXEL_4,
> -  LCD_BITS_PER_PIXEL_8,
> -  LCD_BITS_PER_PIXEL_16_555,
> -  LCD_BITS_PER_PIXEL_24,
> -  LCD_BITS_PER_PIXEL_16_565,
> -  LCD_BITS_PER_PIXEL_12_444
> -} LCD_BPP;
> +  ELcdBitsPerPixel_1 = 0,
> +  ELcdBitsPerPixel_2,
> +  ELcdBitsPerPixel_4,
> +  ELcdBitsPerPixel_8,
> +  ELcdBitsPerPixel_16_555,
> +  ELcdBitsPerPixel_24,
> +  ELcdBitsPerPixel_16_565,
> +  ELcdBitsPerPixel_12_444,
> +  ELcdBitsPerPixel_Max
> +} ELCD_BPP;
> 
>  // Display timing settings.
>  typedef struct {
> @@ -320,7 +321,7 @@ LcdPlatformGetTimings (
>  EFI_STATUS
>  LcdPlatformGetBpp (
>    IN  UINT32                                ModeNumber,
> -  OUT LCD_BPP*                              Bpp
> +  OUT ELCD_BPP*                             Bpp
>    );
> 
>  #endif /* LCD_PLATFORM_LIB_H_ */
> diff --git a/ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.c b/ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.c
> index dca3cf706ee12e2c1e1545e43b862ea87e16395b..ca80eeb83993cfdce6d2428b94b9b8163f0e55ad 100644
> --- a/ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.c
> +++ b/ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.c
> @@ -1,7 +1,7 @@
>  /** @file
> 
>    Copyright (c) 2017, Linaro, Ltd. All rights reserved.
> -  Copyright (c) 2018, Arm Limited. All rights reserved.
> +  Copyright (c) 2018 - 2020, Arm Limited. All rights reserved.<BR>
> 
>    SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -137,7 +137,7 @@ LcdPlatformGetTimings (
>  EFI_STATUS
>  LcdPlatformGetBpp (
>    IN  UINT32                                ModeNumber,
> -  OUT LCD_BPP*                              Bpp
> +  OUT ELCD_BPP*                             Bpp
>    )
>  {
>    ASSERT (FALSE);
> diff --git a/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c b/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c
> index 05b6f8974f12fafd53cdff2314d33f9c93d79670..ace6c5eb3cbbaa784c5d1f40ee3b372551d83820 100644
> --- a/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c
> +++ b/ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c
> @@ -1,7 +1,7 @@
>  /** @file
>    This file contains the platform independent parts of PL111Lcd
> 
> -  Copyright (c) 2011-2018, ARM Ltd. All rights reserved.<BR>
> +  Copyright (c) 2011 - 2020, Arm Limited. All rights reserved.<BR>
> 
>    SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -80,7 +80,7 @@ LcdSetMode (
>    SCAN_TIMINGS      *Horizontal;
>    SCAN_TIMINGS      *Vertical;
>    UINT32            LcdControl;
> -  LCD_BPP           LcdBpp;
> +  ELCD_BPP          LcdBpp;
> 
>    EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  ModeInfo;
> 
> --
> 2.17.1
> 


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

* Re: [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg
  2020-12-03 18:19 [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg PierreGondois
                   ` (15 preceding siblings ...)
  2020-12-03 18:19 ` [PATCH v1 16/16] ArmPlatformPkg: Fix cspell reported spelling/wording PierreGondois
@ 2020-12-09 15:33 ` Ard Biesheuvel
  16 siblings, 0 replies; 19+ messages in thread
From: Ard Biesheuvel @ 2020-12-09 15:33 UTC (permalink / raw)
  To: Pierre.Gondois, leif, thomas.abraham, devel; +Cc: sami.mujawar

On 12/3/20 7:19 PM, Pierre.Gondois@arm.com wrote:
> From: Pierre Gondois <Pierre.Gondois@arm.com>
> 
> The Ecc tools available in the BaseTools package checks for
> good practice coding standards. Some errors reported while
> running Ecc on edk2/ArmPlatformPkg require modifications.
> 
> This patch set has a dependency over a similar patch set
> named "Fix Ecc reported errors from ArmPlatformPkg" for
> edk2-platforms and should not be merged independently.
> 
> The changes can be seen at: https://github.com/PierreARM/edk2/tree/1537_Ecc_ArmPlatformPkg_v1
> 
> Pierre Gondois (16):
>   ArmPlatformPkg: Fix Ecc error 3001 in NorFlashDxe
>   ArmPlatformPkg: Fix Ecc error 3002 in PL011UartLib
>   ArmPlatformPkg: Fix Ecc error 3002 in PL061GpioDxe
>   ArmPlatformPkg: Fix Ecc error 5007 in LcdGraphicsOutputDxe
>   ArmPlatformPkg: Fix Ecc error 5007 in NorFlashDxe
>   ArmPlatformPkg: Fix Ecc error 5007 in PL061GpioDxe
>   ArmPlatformPkg: Fix Ecc error 5007 in PL031RealTimeClockLib
>   ArmPlatformPkg: Fix Ecc error 10016 in PrePi
>   ArmPlatformPkg: Fix Ecc error 10016 in LcdPlatformNullLib
>   ArmPlatformPkg: Fix Ecc error 10014 in LcdGraphicsOutputDxe
>   ArmPlatformPkg: Fix Ecc error 10014 in PL061GpioDxe
>   ArmPlatformPkg: Fix Ecc error 10014 in SP805WatchdogDxe
>   ArmPlatformPkg: Fix Ecc error 10006 in ArmPlatformPkg.dsc
>   ArmPlatformPkg: Fix Ecc error 8001 in PrePi
>   ArmPlatformPkg: Fix Ecc error 8005
>   ArmPlatformPkg: Fix cspell reported spelling/wording
> 

Patches above

Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>

Merged as #1207 into master.

>   ArmPlatformPkg: Fix Ecc error 8005

This one needs further discussion, and alignment with edk2-platforms
changes.


>  ArmPlatformPkg/ArmPlatformPkg.dsc             |  9 +-
>  .../LcdGraphicsOutputBlt.c                    | 98 ++++++++++---------
>  .../LcdGraphicsOutputDxe.c                    | 30 +++---
>  .../LcdGraphicsOutputDxe.h                    |  4 +-
>  .../LcdGraphicsOutputDxe.inf                  |  5 +-
>  .../Drivers/NorFlashDxe/NorFlashDxe.c         |  8 +-
>  .../Drivers/PL061GpioDxe/PL061Gpio.c          | 12 +--
>  .../Drivers/PL061GpioDxe/PL061GpioDxe.inf     |  3 +-
>  .../SP805WatchdogDxe/SP805WatchdogDxe.inf     |  3 +-
>  .../Include/Library/LcdPlatformLib.h          | 21 ++--
>  .../LcdPlatformNullLib/LcdPlatformNullLib.c   |  4 +-
>  .../LcdPlatformNullLib/LcdPlatformNullLib.inf |  3 +-
>  .../Library/PL011UartLib/PL011UartLib.c       | 12 +--
>  .../PL031RealTimeClockLib.c                   |  4 +-
>  ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c    |  4 +-
>  .../PrePi/AArch64/ModuleEntryPoint.S          |  4 +-
>  ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.S   |  4 +-
>  ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.asm |  4 +-
>  ArmPlatformPkg/PrePi/PeiUniCore.inf           |  3 +-
>  ArmPlatformPkg/PrePi/PrePi.h                  |  4 +-
>  20 files changed, 126 insertions(+), 113 deletions(-)
> 
> --
> 2.17.1
> 


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

end of thread, other threads:[~2020-12-09 15:33 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-03 18:19 [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg PierreGondois
2020-12-03 18:19 ` [PATCH v1 01/16] ArmPlatformPkg: Fix Ecc error 3001 in NorFlashDxe PierreGondois
2020-12-03 18:19 ` [PATCH v1 02/16] ArmPlatformPkg: Fix Ecc error 3002 in PL011UartLib PierreGondois
2020-12-03 18:19 ` [PATCH v1 03/16] ArmPlatformPkg: Fix Ecc error 3002 in PL061GpioDxe PierreGondois
2020-12-03 18:19 ` [PATCH v1 04/16] ArmPlatformPkg: Fix Ecc error 5007 in LcdGraphicsOutputDxe PierreGondois
2020-12-03 18:19 ` [PATCH v1 05/16] ArmPlatformPkg: Fix Ecc error 5007 in NorFlashDxe PierreGondois
2020-12-03 18:19 ` [PATCH v1 06/16] ArmPlatformPkg: Fix Ecc error 5007 in PL061GpioDxe PierreGondois
2020-12-03 18:19 ` [PATCH v1 07/16] ArmPlatformPkg: Fix Ecc error 5007 in PL031RealTimeClockLib PierreGondois
2020-12-03 18:19 ` [PATCH v1 08/16] ArmPlatformPkg: Fix Ecc error 10016 in PrePi PierreGondois
2020-12-03 18:19 ` [PATCH v1 09/16] ArmPlatformPkg: Fix Ecc error 10016 in LcdPlatformNullLib PierreGondois
2020-12-03 18:19 ` [PATCH v1 10/16] ArmPlatformPkg: Fix Ecc error 10014 in LcdGraphicsOutputDxe PierreGondois
2020-12-03 18:19 ` [PATCH v1 11/16] ArmPlatformPkg: Fix Ecc error 10014 in PL061GpioDxe PierreGondois
2020-12-03 18:19 ` [PATCH v1 12/16] ArmPlatformPkg: Fix Ecc error 10014 in SP805WatchdogDxe PierreGondois
2020-12-03 18:19 ` [PATCH v1 13/16] ArmPlatformPkg: Fix Ecc error 10006 in ArmPlatformPkg.dsc PierreGondois
2020-12-03 18:19 ` [PATCH v1 14/16] ArmPlatformPkg: Fix Ecc error 8001 in PrePi PierreGondois
2020-12-03 18:19 ` [PATCH v1 15/16] ArmPlatformPkg: Fix Ecc error 8005 PierreGondois
2020-12-09 15:09   ` Ard Biesheuvel
2020-12-03 18:19 ` [PATCH v1 16/16] ArmPlatformPkg: Fix cspell reported spelling/wording PierreGondois
2020-12-09 15:33 ` [PATCH v1 00/16] Fix Ecc reported errors in ArmPlatformPkg Ard Biesheuvel

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