From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C889481ED5 for ; Thu, 24 Nov 2016 18:11:52 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 24 Nov 2016 18:11:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,692,1473145200"; d="scan'208,217";a="9108651" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga002.jf.intel.com with ESMTP; 24 Nov 2016 18:11:52 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 24 Nov 2016 18:11:51 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.239]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.96]) with mapi id 14.03.0248.002; Fri, 25 Nov 2016 10:11:48 +0800 From: "Bi, Dandan" To: "Yao, Jiewen" , "edk2-devel@lists.01.org" Thread-Topic: [patch] MdeModulePkg: Fix GCC build failure Thread-Index: AQHSRr1LThFn5qJ1Dkyx1YMXl5WukqDo746wgAAE7DA= Date: Fri, 25 Nov 2016 02:11:47 +0000 Message-ID: <3C0D5C461C9E904E8F62152F6274C0BB39662D08@shsmsx102.ccr.corp.intel.com> References: <1480038171-76516-1-git-send-email-dandan.bi@intel.com> <74D8A39837DF1E4DA445A8C0B3885C50386DA995@shsmsx102.ccr.corp.intel.com> In-Reply-To: <74D8A39837DF1E4DA445A8C0B3885C50386DA995@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: Re: [patch] MdeModulePkg: Fix GCC build failure X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Nov 2016 02:11:52 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Got it ! I will enhance the logic! Thanks! Regards, Dandan From: Yao, Jiewen Sent: Friday, November 25, 2016 10:01 AM To: Bi, Dandan ; edk2-devel@lists.01.org Cc: Pete Batard Subject: RE: [patch] MdeModulePkg: Fix GCC build failure Thanks I am OK on most part. However, I think we had better do some basic check for below: > // > // Create break event > // > - Status =3D gBS->CreateEvent ( > + gBS->CreateEvent ( > EVT_TIMER | EVT_NOTIFY_SIGNAL, > TPL_CALLBACK, > EbcDebuggerBreakEventFunc, > NULL, > &mDebuggerPrivate.BreakEvent > ); > - Status =3D gBS->SetTimer ( > + gBS->SetTimer ( > mDebuggerPrivate.BreakEvent, > TimerPeriodic, > EFI_DEBUG_BREAK_TIMER_INTERVAL > ); If CreateEvent() fails, it does not make sense to call SetTimer(). Also CloseEvent (mDebuggerPrivate.BreakEvent); is called directly later. So I suggest we add a Status check for CreateEvent. Also for NULL check in = CloseEvent Thank you Yao Jiewen > -----Original Message----- > From: Bi, Dandan > Sent: Friday, November 25, 2016 9:43 AM > To: edk2-devel@lists.01.org > Cc: Pete Batard >; Yao, Jiewen > > Subject: [patch] MdeModulePkg: Fix GCC build failure > > Remove the variables which are set but not used. > > Cc: Pete Batard > > Cc: Jiewen Yao > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Dandan Bi = > > --- > MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c | 3 > --- > MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c | 5 > ----- > MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c | > 9 ++++----- > MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c | 2 > -- > 4 files changed, 4 insertions(+), 15 deletions(-) > > diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c > b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c > index e0b85c7..adc1c50 100644 > --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c > +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c > @@ -192,11 +192,10 @@ Returns: > > --*/ > { > UINT64 Address; > UINTN Index; > - UINT16 OldInstruction; > BOOLEAN IsHitBreakpoint; > > // > // Roll back IP for breakpoint instruction (BREAK(3) : 0x0300) > // > @@ -207,11 +206,10 @@ Returns: > // > IsHitBreakpoint =3D FALSE; > for (Index =3D 0; (Index < DebuggerPrivate->DebuggerBreakpointCount) &= & > (Index < EFI_DEBUGGER_BREAKPOINT_MAX); Index++) { > if > ((DebuggerPrivate->DebuggerBreakpointContext[Index].BreakpointAddress > =3D=3D Address) && > (DebuggerPrivate->DebuggerBreakpointContext[Index].State)) { > - OldInstruction =3D > (UINT16)DebuggerPrivate->DebuggerBreakpointContext[Index].OldInstructi > on; > IsHitBreakpoint =3D TRUE; > break; > } > } > > @@ -242,11 +240,10 @@ Returns: > // > IsHitBreakpoint =3D FALSE; > for (Index =3D 0; (Index < DebuggerPrivate->DebuggerBreakpointCount) > && (Index < EFI_DEBUGGER_BREAKPOINT_MAX); Index++) { > if > ((DebuggerPrivate->DebuggerBreakpointContext[Index].BreakpointAddress > =3D=3D Address) && > (DebuggerPrivate->DebuggerBreakpointContext[Index].State)) > { > - OldInstruction =3D > (UINT16)DebuggerPrivate->DebuggerBreakpointContext[Index].OldInstructi > on; > IsHitBreakpoint =3D TRUE; > break; > } > } > > diff --git > a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c > b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c > index 4be6dd4..a137ea9 100644 > --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c > +++ > b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c > @@ -437,12 +437,10 @@ Returns: > > --*/ > { > UINTN Index; > EFI_STATUS Status; > - UINTN Address; > - UINT16 OldInstruction; > > if (CommandArg =3D=3D NULL) { > EDBPrint (L"BreakpointClear Argument error!\n"); > return EFI_DEBUG_CONTINUE; > } > @@ -464,13 +462,10 @@ Returns: > > if ((Index >=3D EFI_DEBUGGER_BREAKPOINT_MAX) || > (Index >=3D DebuggerPrivate->DebuggerBreakpointCount)) { > EDBPrint (L"BreakpointClear error!\n"); > return EFI_DEBUG_CONTINUE; > - } else { > - Address =3D > (UINTN)DebuggerPrivate->DebuggerBreakpointContext[Index].BreakpointA > ddress; > - OldInstruction =3D > (UINT16)DebuggerPrivate->DebuggerBreakpointContext[Index].OldInstructi > on; > } > > // > // Delete breakpoint > // > diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c > b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c > index 9196adb..696ab74 100644 > --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c > +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c > @@ -387,11 +387,10 @@ Arguments: > Returns: > None > > --*/ > { > - EFI_STATUS Status; > UINTN Index; > EFI_DEBUGGER_SYMBOL_OBJECT *Object; > EFI_DEBUGGER_SYMBOL_ENTRY *Entry; > > > @@ -431,35 +430,35 @@ Returns: > } > > // > // locate PciRootBridgeIo > // > - Status =3D gBS->LocateProtocol ( > + gBS->LocateProtocol ( > &gEfiPciRootBridgeIoProtocolGuid, > NULL, > (VOID**) &mDebuggerPrivate.PciRootBridgeIo > ); > > // > // locate DebugImageInfoTable > // > - Status =3D EfiGetSystemConfigurationTable ( > + EfiGetSystemConfigurationTable ( > &gEfiDebugImageInfoTableGuid, > (VOID**) > &mDebuggerPrivate.DebugImageInfoTableHeader > ); > > // > // Create break event > // > - Status =3D gBS->CreateEvent ( > + gBS->CreateEvent ( > EVT_TIMER | EVT_NOTIFY_SIGNAL, > TPL_CALLBACK, > EbcDebuggerBreakEventFunc, > NULL, > &mDebuggerPrivate.BreakEvent > ); > - Status =3D gBS->SetTimer ( > + gBS->SetTimer ( > mDebuggerPrivate.BreakEvent, > TimerPeriodic, > EFI_DEBUG_BREAK_TIMER_INTERVAL > ); > > diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c > b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c > index 9573c43..a1d21aa 100644 > --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c > +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c > @@ -191,19 +191,17 @@ Returns: > > --*/ > { > CHAR8 *LineBuffer; > CHAR8 *FieldBuffer; > - EFI_DEBUGGER_SYMBOL_ENTRY *Entry; > EDB_EBC_MAP_PARSE_STATE MapParseState; > EDB_EBC_SYMBOL_PARSE_STATE SymbolParseState; > CHAR8 *Name; > CHAR8 *ObjName; > UINTN Address; > EFI_DEBUGGER_SYMBOL_TYPE Type; > > - Entry =3D Object->Entry; > > // > // Begin to parse the Buffer > // > LineBuffer =3D AsciiStrGetNewTokenLine (Buffer, "\n\r"); > -- > 1.9.5.msysgit.1