public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "PierreGondois" <pierre.gondois@arm.com>
To: leif@nuviainc.com, ard.biesheuvel@arm.com,
	thomas.abraham@arm.com, devel@edk2.groups.io
Cc: sami.mujawar@arm.com
Subject: [PATCH v1 04/16] ArmPlatformPkg: Fix Ecc error 5007 in LcdGraphicsOutputDxe
Date: Thu,  3 Dec 2020 18:19:33 +0000	[thread overview]
Message-ID: <20201203181945.10880-5-Pierre.Gondois@arm.com> (raw)
In-Reply-To: <20201203181945.10880-1-Pierre.Gondois@arm.com>

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


  parent reply	other threads:[~2020-12-03 18:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` PierreGondois [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201203181945.10880-5-Pierre.Gondois@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox