From: Leif Lindholm <leif.lindholm@linaro.org>
To: Eric Jin <eric.jin@intel.com>
Cc: edk2-devel@lists.01.org, Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Subject: Re: [edk2-test][Patch] uefi-sct/SctPkg:Correct macro name style in HwErrRecVariable Test
Date: Wed, 12 Dec 2018 15:06:17 +0000 [thread overview]
Message-ID: <20181212150617.6jc6plcs2wgbnigg@bivouac.eciton.net> (raw)
In-Reply-To: <20181212033214.10456-1-eric.jin@intel.com>
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 <leif.lindholm@linaro.org>
> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Eric Jin <eric.jin@intel.com>
> ---
> 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 <leif.lindholm@linaro.org>
>
> 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
>
next prev parent reply other threads:[~2018-12-12 15:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-12 3:32 [edk2-test][Patch] uefi-sct/SctPkg:Correct macro name style in HwErrRecVariable Test Eric Jin
2018-12-12 15:06 ` Leif Lindholm [this message]
2018-12-12 21:07 ` Supreeth Venkatesh
2018-12-14 7:12 ` Jin, Eric
2018-12-14 10:59 ` Line endings: Was "Re: [edk2-test][Patch] uefi-sct/SctPkg:Correct macro name style in HwErrRecVariable Test" Leif Lindholm
2018-12-14 13:24 ` Laszlo Ersek
2018-12-14 17:12 ` Supreeth Venkatesh
2018-12-14 19:57 ` Laszlo Ersek
2018-12-14 23:54 ` Supreeth Venkatesh
2018-12-15 3:59 ` Jin, Eric
2018-12-17 9:34 ` Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181212150617.6jc6plcs2wgbnigg@bivouac.eciton.net \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox