From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::441; helo=mail-wr1-x441.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6E4682119C8B7 for ; Wed, 12 Dec 2018 07:06:22 -0800 (PST) Received: by mail-wr1-x441.google.com with SMTP id 96so18056243wrb.2 for ; Wed, 12 Dec 2018 07:06:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=NMibPwsG1fgJ6WYuKoo2yo6j0EA6qlnT3Vpxcx/Kadg=; b=YRMUTUMQn4kKDl1/CKXFsV/1vpYm+WPdSHzBluWIbuvoJGLCStPIF5WIHFFnpqtCzl yJfnMPt7N0NyePlpqh/XBrDeWWU+z8L+IUUThJx6syIDcPeIHj9BZUVo3a/DMjdGNBmL 5kQh/xVVqW5te+5zhuy/tVP7SN1XZwuKq3gAQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=NMibPwsG1fgJ6WYuKoo2yo6j0EA6qlnT3Vpxcx/Kadg=; b=f/2e/v67Cw1Xl1UB5iQCu1ONJ66ST2JihKTz+hN0+4BBMBq4COLIvbR+Dt6qccqN+r II8mojaj/S6A4Xaqam7Stf2g3esoiMIylgdBgx8aJcyoQqcmQhYaGVaEWXVVTDSVKC3/ cnXlRvmgo/YqTbKfFUt9roaZgoiR6lEuzkWDyRWXdeOLDebqTlhOl5Riy6N+wHXhILcX DyK/qPu8H9Gd9MKlBBEA9KTIvP1QtMzbWr5acZBApyFtKFqVKKI4y8gvTEV1RUpy34k+ bYjCyZumxvdadB/H/xG1xGGMr2LNF0z0/EVVptlkJNnyEBlULQCwVwgCSU5O3INwYnTi +mgg== X-Gm-Message-State: AA+aEWYDfqalof+GkMoewKhxucR3mAmzWQgtQd68TTZKmeodOKv91etz xG7wxSj5UEg2oE+dk86g6M8+9A== X-Google-Smtp-Source: AFSGD/VSFj2ZkB4FKT/XRDos/rbn1YbXP68uehieonILDagOHGGskMIssc0sXm7P9xl+YSNe6q/jmw== X-Received: by 2002:adf:80a9:: with SMTP id 38mr16326429wrl.137.1544627179930; Wed, 12 Dec 2018 07:06:19 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id 133sm2961388wme.9.2018.12.12.07.06.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Dec 2018 07:06:19 -0800 (PST) Date: Wed, 12 Dec 2018 15:06:17 +0000 From: Leif Lindholm To: Eric Jin Cc: edk2-devel@lists.01.org, Supreeth Venkatesh Message-ID: <20181212150617.6jc6plcs2wgbnigg@bivouac.eciton.net> References: <20181212033214.10456-1-eric.jin@intel.com> MIME-Version: 1.0 In-Reply-To: <20181212033214.10456-1-eric.jin@intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [edk2-test][Patch] uefi-sct/SctPkg:Correct macro name style in HwErrRecVariable Test 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: Wed, 12 Dec 2018 15:06:22 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Eric, On Wed, Dec 12, 2018 at 11:32:14AM +0800, Eric Jin wrote: > Name macros appropriately to follow the rule > in coding standards specification. > Change the following macro from variable style > HwErrRecVariableNameLength > HwErrRecVariableNamePrefixLength > HwErrRecVariableNameIndexLength > to macro style. > HW_ERR_REC_VARIABLE_NAME_LEN > HW_ERR_REC_VARIABLE_NAME_PREFIX_LEN > HW_ERR_REC_VARIABLE_NAME_INDEX_LEN > > Cc: Leif Lindholm > Cc: Supreeth Venkatesh > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Eric Jin > --- > uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/VariableServicesBBTestMain.h | 6 +++--- > uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/VariableServicesBBTestFunction.c | 22 +++++++++++----------- > 2 files changed, 14 insertions(+), 14 deletions(-) Both the patch generation and the code changes look good to me, thanks! Reviewed-by: Leif Lindholm > > diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/VariableServicesBBTestMain.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/VariableServicesBBTestMain.h > index 426b762..7eaa56d 100644 > --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/VariableServicesBBTestMain.h > +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/VariableServicesBBTestMain.h > @@ -131,9 +131,9 @@ Abstract: > // The prefix length is 8, index length is 4. > // Consider the tail of string, the name length is 13. > // > -#define HwErrRecVariableNameLength 13 > -#define HwErrRecVariableNamePrefixLength 8 > -#define HwErrRecVariableNameIndexLength 4 > +#define HW_ERR_REC_VARIABLE_NAME_LEN 13 > +#define HW_ERR_REC_VARIABLE_NAME_PREFIX_LEN 8 > +#define HW_ERR_REC_VARIABLE_NAME_INDEX_LEN 4 > > // > // Global Variables > diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/VariableServicesBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/VariableServicesBBTestFunction.c > index a016476..015a78a 100644 > --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/VariableServicesBBTestFunction.c > +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/VariableServicesBBTestFunction.c > @@ -2855,7 +2855,7 @@ HardwareErrorRecordFuncTest ( > UINT64 RemainingVariableStorageSize; > UINT64 MaximumVariableSize; > > - CHAR16 HwErrRecVariableName[HwErrRecVariableNameLength]; > + CHAR16 HwErrRecVariableName[HW_ERR_REC_VARIABLE_NAME_LEN]; > CHAR16 HwErrRecVariable[] = L"This is a HwErrRec variable!"; > > CHAR16 GetVariableName[MAX_BUFFER_SIZE]; > @@ -2864,7 +2864,7 @@ HardwareErrorRecordFuncTest ( > > UINTN Num; > UINTN MaxNum = 0; > - CHAR16 ErrorNum[HwErrRecVariableNameIndexLength+1]; > + CHAR16 ErrorNum[HW_ERR_REC_VARIABLE_NAME_INDEX_LEN + 1]; > > CHAR16 HwErrRecGetVariable[255]; > > @@ -2982,7 +2982,7 @@ HardwareErrorRecordFuncTest ( > // Get a useable variable name > // > GetVariableName[0] = L'\0'; > - ErrorNum[HwErrRecVariableNameIndexLength] = L'\0'; > + ErrorNum[HW_ERR_REC_VARIABLE_NAME_INDEX_LEN] = L'\0'; > > > while (TRUE) { > @@ -3005,9 +3005,9 @@ HardwareErrorRecordFuncTest ( > break; > } > > - if ( (SctStrnCmp (GetVariableName, L"HwErrRec", HwErrRecVariableNamePrefixLength) == 0) && > + if ( (SctStrnCmp (GetVariableName, L"HwErrRec", HW_ERR_REC_VARIABLE_NAME_PREFIX_LEN) == 0) && > (SctCompareGuid (&VendorGuid, &gHwErrRecGuid) == 0) ) { > - SctStrnCpy (ErrorNum, &GetVariableName[HwErrRecVariableNamePrefixLength], HwErrRecVariableNameIndexLength); > + SctStrnCpy (ErrorNum, &GetVariableName[HW_ERR_REC_VARIABLE_NAME_PREFIX_LEN], HW_ERR_REC_VARIABLE_NAME_INDEX_LEN); > Num = SctXtoi (ErrorNum); > if (MaxNum < Num) > MaxNum = Num; > @@ -3018,8 +3018,8 @@ HardwareErrorRecordFuncTest ( > > HwErrRecVariableName[0] = L'\0'; > SctStrCat ( HwErrRecVariableName, L"HwErrRec" ); > - Myitox( MaxNum, HwErrRecVariableName+HwErrRecVariableNamePrefixLength ); > - HwErrRecVariableName[HwErrRecVariableNameLength-1] = L'\0'; > + Myitox( MaxNum, HwErrRecVariableName + HW_ERR_REC_VARIABLE_NAME_PREFIX_LEN ); > + HwErrRecVariableName[HW_ERR_REC_VARIABLE_NAME_LEN - 1] = L'\0'; > > // > // Set the new HwErrRec variable to the global variable > @@ -3042,8 +3042,8 @@ HardwareErrorRecordFuncTest ( > // and writes the useful data - HwErrRecVariableName - to RecoveryData[2] > // > RecoveryData[0] = 2; > - SctStrnCpy ( (CHAR16*)(&RecoveryData[2]), HwErrRecVariableName, HwErrRecVariableNameLength-1 ); > - RecoveryLib->WriteResetRecord( RecoveryLib, HwErrRecVariableNameLength*sizeof(CHAR16)+2, RecoveryData ); > + SctStrnCpy ( (CHAR16*)(&RecoveryData[2]), HwErrRecVariableName, HW_ERR_REC_VARIABLE_NAME_LEN - 1 ); > + RecoveryLib->WriteResetRecord( RecoveryLib, HW_ERR_REC_VARIABLE_NAME_LEN * sizeof(CHAR16) + 2, RecoveryData ); > > // > // Prompt the user about the cold reset and reset the system > @@ -3059,8 +3059,8 @@ HardwareErrorRecordFuncTest ( > // > step2: > DataSize = 255; > - HwErrRecVariableName[HwErrRecVariableNameLength-1] = L'\0'; > - SctStrnCpy ( HwErrRecVariableName, (CHAR16*)(RecoveryData+2), HwErrRecVariableNameLength-1 ); > + HwErrRecVariableName[HW_ERR_REC_VARIABLE_NAME_LEN - 1] = L'\0'; > + SctStrnCpy ( HwErrRecVariableName, (CHAR16*)(RecoveryData+2), HW_ERR_REC_VARIABLE_NAME_LEN - 1 ); > Status = RT->GetVariable ( > HwErrRecVariableName, > &gHwErrRecGuid, > -- > 2.20.0.windows.1 >