diff mbox

[edk2] Fix: MdeModulePkg: Implement UEFI25 HII Config keyword handler protocol.

Message ID 1431597531-26785-1-git-send-email-ryan.harkin@linaro.org
State New
Headers show

Commit Message

Ryan Harkin May 14, 2015, 9:58 a.m. UTC
This patch removes the unused DevicePathSize variable.

The following commit introduces the DevicePathSize variable in function
GetStringIdFromDatabase:

	commit 87bfeb11f84dd1d369bb2e195ef83d20b0d80d61
	Author: Eric Dong <eric.dong@intel.com>
	Date:   Wed May 13 08:35:29 2015 +0000

	    MdeModulePkg: Implement UEFI25 HII Config keyword handler protocol.

This variable is declared, initialised, conditionally set, but never
used.  The ARM64 builds reject unused variables as an error, eg:

	/linaro/working/edk2.git/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c:
	In function 'EnumerateAllKeywords':
	/linaro/working/edk2.git/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c:2568:9:
	error: variable 'DevicePathSize' set but not used
	[-Werror=unused-but-set-variable]
	   UINTN                               DevicePathSize;

Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
---
 MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Ryan Harkin May 14, 2015, 10:16 a.m. UTC | #1
OK, so it seems Ard beat me to it and posted a patch already.

On 14 May 2015 at 10:58, Ryan Harkin <ryan.harkin@linaro.org> wrote:

> This patch removes the unused DevicePathSize variable.
>
> The following commit introduces the DevicePathSize variable in function
> GetStringIdFromDatabase:
>
>         commit 87bfeb11f84dd1d369bb2e195ef83d20b0d80d61
>         Author: Eric Dong <eric.dong@intel.com>
>         Date:   Wed May 13 08:35:29 2015 +0000
>
>             MdeModulePkg: Implement UEFI25 HII Config keyword handler
> protocol.
>
> This variable is declared, initialised, conditionally set, but never
> used.  The ARM64 builds reject unused variables as an error, eg:
>
>
> /linaro/working/edk2.git/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c:
>         In function 'EnumerateAllKeywords':
>
> /linaro/working/edk2.git/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c:2568:9:
>         error: variable 'DevicePathSize' set but not used
>         [-Werror=unused-but-set-variable]
>            UINTN                               DevicePathSize;
>
> Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
> ---
>  MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
> b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
> index c3cd064..1756c15 100644
> --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
> +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
> @@ -2565,7 +2565,6 @@ EnumerateAllKeywords (
>    UINT8                               *DevicePathPkg;
>    UINT8                               *DevicePath;
>    HII_DATABASE_RECORD                 *DataBaseRecord;
> -  UINTN                               DevicePathSize;
>    HII_DATABASE_PACKAGE_LIST_INSTANCE  *PackageListNode;
>    HII_STRING_PACKAGE_INSTANCE         *StringPackage;
>    CHAR8                               *LocalNameSpace;
> @@ -2580,7 +2579,6 @@ EnumerateAllKeywords (
>    BOOLEAN                             ReadOnly;
>
>    DataBaseRecord   = NULL;
> -  DevicePathSize   = 0;
>    Status           = EFI_SUCCESS;
>    MultiKeywordResp = NULL;
>    DevicePath       = NULL;
> @@ -2600,7 +2598,6 @@ EnumerateAllKeywords (
>      DataBaseRecord = CR (Link, HII_DATABASE_RECORD, DatabaseEntry,
> HII_DATABASE_RECORD_SIGNATURE);
>      if ((DevicePathPkg = DataBaseRecord->PackageList->DevicePathPkg) !=
> NULL) {
>        DevicePath = DevicePathPkg + sizeof (EFI_HII_PACKAGE_HEADER);
> -      DevicePathSize    = GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *)
> DevicePath);
>      }
>      PackageListNode = DataBaseRecord->PackageList;
>
> --
> 2.1.0
>
>
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
diff mbox

Patch

diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
index c3cd064..1756c15 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigKeywordHandler.c
@@ -2565,7 +2565,6 @@  EnumerateAllKeywords (
   UINT8                               *DevicePathPkg;
   UINT8                               *DevicePath;
   HII_DATABASE_RECORD                 *DataBaseRecord;
-  UINTN                               DevicePathSize;
   HII_DATABASE_PACKAGE_LIST_INSTANCE  *PackageListNode;
   HII_STRING_PACKAGE_INSTANCE         *StringPackage;
   CHAR8                               *LocalNameSpace;
@@ -2580,7 +2579,6 @@  EnumerateAllKeywords (
   BOOLEAN                             ReadOnly;
 
   DataBaseRecord   = NULL;
-  DevicePathSize   = 0;
   Status           = EFI_SUCCESS;
   MultiKeywordResp = NULL;
   DevicePath       = NULL;
@@ -2600,7 +2598,6 @@  EnumerateAllKeywords (
     DataBaseRecord = CR (Link, HII_DATABASE_RECORD, DatabaseEntry, HII_DATABASE_RECORD_SIGNATURE);
     if ((DevicePathPkg = DataBaseRecord->PackageList->DevicePathPkg) != NULL) {
       DevicePath = DevicePathPkg + sizeof (EFI_HII_PACKAGE_HEADER);
-      DevicePathSize    = GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) DevicePath);
     }
     PackageListNode = DataBaseRecord->PackageList;