On 01/15/19 07:16, Zeng, Star wrote:
> On 2019/1/15 14:01, Wang, Jian J wrote:
>> Hi Star,
>>
>> Just two minor comments below.
>>
>>> -----Original Message-----
>>> From: Zeng, Star
>>> Sent: Monday, January 14, 2019 11:20 PM
>>> To: [email protected]
>>> Cc: Zeng, Star <[email protected]>; Wang, Jian J
>>> <[email protected]>;
>>> Wu, Hao A <[email protected]>; Kinney, Michael D
>>> <[email protected]>; Gao, Liming <[email protected]>; Ni,
>>> Ray
>>> <[email protected]>; Laszlo Ersek <[email protected]>; Ard Biesheuvel
>>> <[email protected]>
>>> Subject: [PATCH V2 08/15] MdeModulePkg Variable: Add emulated
>>> variable NV
>>> mode support
>>> @@ -3894,9 +4024,19 @@ InitNonVolatileVariableStore (
>>> UINTN VariableSize;
>>> EFI_STATUS Status;
>>>
>>> - Status = InitRealNonVolatileVariableStore (&VariableStoreBase);
>>> - if (EFI_ERROR (Status)) {
>>> - return Status;
>>> + if (!PcdGetBool (PcdEmuVariableNvModeEnable)) {
>>> + Status = InitRealNonVolatileVariableStore (&VariableStoreBase);
>>> + if (EFI_ERROR (Status)) {
>>> + return Status;
>>> + }
>>> + mVariableModuleGlobal->VariableGlobal.EmuNvMode = FALSE;
>>> + } else {
>>> + Status = InitEmuNonVolatileVariableStore (&VariableStoreBase);
>>> + if (EFI_ERROR (Status)) {
>>> + return Status;
>>> + }
>>> + mVariableModuleGlobal->VariableGlobal.EmuNvMode = TRUE;
>>> + DEBUG ((DEBUG_INFO, "Variable driver will work at emulated
>>> non-volatile
>>> variable mode!\n"));
>>> }
>>>
>>
>> The logic is not wrong, just the if/else style might cause confusion at
>> the first glance. Swapping the if/else might let the code more clear.
>>
>> if (PcdGetBool (PcdEmuVariableNvModeEnable)) {
>> ...initialize emulated variable store...
>> } else {
>> ...initialize the real nv variable store...
>> }
>
> I am neutral about it. I can update it if no other comment.
I agree with Jian: the change that he suggests does not complicate the
patch, and the end result is slightly more readable.
Thanks
Laszlo
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel