From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=jian.j.wang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (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 1D647211B5A57 for ; Tue, 15 Jan 2019 00:06:31 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jan 2019 00:06:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,481,1539673200"; d="scan'208";a="125981904" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by FMSMGA003.fm.intel.com with ESMTP; 15 Jan 2019 00:06:31 -0800 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 15 Jan 2019 00:06:31 -0800 Received: from shsmsx107.ccr.corp.intel.com ([169.254.9.239]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.85]) with mapi id 14.03.0415.000; Tue, 15 Jan 2019 16:06:29 +0800 From: "Wang, Jian J" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Wu, Hao A" , Laszlo Ersek Thread-Topic: [PATCH V2 07/15] MdeModulePkg Variable: type case VolatileBase to UINTN directly Thread-Index: AQHUrByrJQqtal/kq0WZ7H9GVZ2unqWv+gdw Date: Tue, 15 Jan 2019 08:06:29 +0000 Message-ID: References: <1547479196-40248-1-git-send-email-star.zeng@intel.com> <1547479196-40248-8-git-send-email-star.zeng@intel.com> In-Reply-To: <1547479196-40248-8-git-send-email-star.zeng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNWM0OWU4MjgtNzMwYi00OTRjLWIwMWMtZjAwNTVkNWU4NzlmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMDlnYnk0ZGh0aklMVGVMOWN2dTNSQ0FBSVRGMFhXTklnaURoaXJySzdyZm1NZUt4SFo1cGtwWnpCV053T3BSbiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH V2 07/15] MdeModulePkg Variable: type case VolatileBase to UINTN directly X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jan 2019 08:06:32 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jian J Wang > -----Original Message----- > From: Zeng, Star > Sent: Monday, January 14, 2019 11:20 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Wang, Jian J ; > Wu, Hao A ; Laszlo Ersek > Subject: [PATCH V2 07/15] MdeModulePkg Variable: type case VolatileBase t= o > UINTN directly >=20 > Simplify > ((UINTN) ((UINT8 *) VolatileBase + VolatileBase->Size)) > to > ((UINTN) VolatileBase + VolatileBase->Size) >=20 > This patch prepares for adding emulated variable NV mode > support in VariableRuntimeDxe. >=20 > Cc: Jian J Wang > Cc: Hao Wu > Cc: Laszlo Ersek > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Star Zeng > --- > MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > index 4d524db30fec..4c8e1d8cf4f1 100644 > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > @@ -301,7 +301,7 @@ UpdateVariableStore ( > DataPtr +=3D mVariableModuleGlobal->VariableGlobal.VolatileVariabl= eBase; > } >=20 > - if ((DataPtr + DataSize) > ((UINTN) ((UINT8 *) VolatileBase + Volati= leBase- > >Size))) { > + if ((DataPtr + DataSize) > ((UINTN) VolatileBase + VolatileBase->Siz= e)) { > return EFI_OUT_OF_RESOURCES; > } >=20 > -- > 2.7.0.windows.1