Reviewed-by: Eric Dong <[email protected]>

Checked in code at r81124.

-----Original Message-----
From: Laszlo Ersek [mailto:[email protected]] 
Sent: Saturday, December 13, 2014 11:33 AM
To: [email protected]; Dong, Eric; Gao, Liming; [email protected]
Subject: [PATCH] MdeModulePkg: SetupBrowserDxe: drop unused but set variable 
'PathHdr'

The 'DEBUG_GCC4._(AARCH64|ARM)_CC_FLAGS' settings do not pass the 
-Wno-unused-but-set-variable option to the compiler.

(See

  egrep '(DEBUG|RELEASE)_GCC4._(AARCH64|ARM)_CC_FLAGS' Conf/tools_def.txt
)

Consequently, recent commit SVN r16499 ("MdeModulePkg: Update the device path 
info for the storage when former drivers not provide it.") breaks such builds 
with the following error message:

  MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c:
    In function 'IsDevicePathExist':

  MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c:469:14:
    error: variable 'PathHdr' set but not used
    [-Werror=unused-but-set-variable]

     EFI_STRING               PathHdr;
                ^
  cc1: all warnings being treated as errors

Eliminate the variable.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <[email protected]>
---
 MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c 
b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
index e9cdea0..d82e08e 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
@@ -466,7 +466,6 @@ IsDevicePathExist (
   )
 {
   UINTN                    Length;
-  EFI_STRING               PathHdr;
 
   for (; (*String != 0 && StrnCmp (String, L"PATH=", StrLen (L"PATH=")) != 0); 
String++);
   if (*String == 0) {
@@ -477,7 +476,6 @@ IsDevicePathExist (
   if (*String == 0) {
     return FALSE;
   }
-  PathHdr = String;
 
   for (Length = 0; *String != 0 && *String != L'&'; String++, Length++);
   if (((Length + 1) / 2) < sizeof (EFI_DEVICE_PATH_PROTOCOL)) {
--
1.8.3.1


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to