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::343; helo=mail-wm1-x343.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) (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 37502211A43B5 for ; Fri, 14 Dec 2018 02:59:22 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id y1so5230052wmi.3 for ; Fri, 14 Dec 2018 02:59:22 -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=YCVAlsd/jdYcJm5uA1+p9PIdc3ZhBhpaUJr952Rwl9U=; b=K/8QAy2bKSy6iuhzaD4LkCj8s20jds+FGHGuSEZekPN8foK0QGj72YP0rWk39eZzYn 7S1gotUwc8qQrhNlM/1Ok3MhcJ+aOfLuckdIcntNra4phmSKJnUBBIumF5D8/DX/twwT KmQFqvlXf4w5IqxB0KeuvpQ7Wi1kQtiTMhGMM= 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=YCVAlsd/jdYcJm5uA1+p9PIdc3ZhBhpaUJr952Rwl9U=; b=BP2M7sAI1jqK1+QqWthLm9v+QeQ9qsr/6LyBshL9U4wndxHd1So2u+EhpbXTtz89zD jDXcWZSjW3UeEh4+JkqAGs0+8DJZq3s9xK2z4nl9EuQSxaEMouL3DjztmQIQp8sPva5y oTtAPDkcIDrCweJPypuCNc2BcWdcrHGc1oUORUHbpRc/WL1759/XKQhDHUuk5dZCjWoI 9A24HnxyzIuRIVAADJnERqfkqMjWoCeHr4TSlx0GP+xK2lEN3IcWx9SyKXw/Lu9suDEe fDdjrVzmgMWcI7IZZFQOvyCZEgh0f0LzxuVToh0Blfy1NmTlCC5qGaqDbLkpVdWyi3gg RtDA== X-Gm-Message-State: AA+aEWZ0ZlQ2ZPtD+RLb4sYWilBw/a+REyB6pcsu+0fpPD41eyDWKT/A RPu3xrd9laElVooZZD0iNN1uCQ== X-Google-Smtp-Source: AFSGD/V4q/25Uu/JLxCvdjdmc4J/HV53EunxQmaY2VgPMurzcfINhrrOH1U86dqWSPOsBWlX0hCcww== X-Received: by 2002:a7b:c0c5:: with SMTP id s5mr2962703wmh.40.1544785159994; Fri, 14 Dec 2018 02:59: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 n9sm3329351wrx.80.2018.12.14.02.59.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Dec 2018 02:59:19 -0800 (PST) Date: Fri, 14 Dec 2018 10:59:17 +0000 From: Leif Lindholm To: Andrew Fish , Laszlo Ersek , Michael D Kinney Cc: Supreeth Venkatesh , "edk2-devel@lists.01.org" , "Jin, Eric" Message-ID: <20181214105917.qaplwp3vtspieig7@bivouac.eciton.net> References: <20181212033214.10456-1-eric.jin@intel.com> <31cc8b433744850df7d65f73d3f2a6aa7840e71b.camel@arm.com> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Line endings: Was "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: Fri, 14 Dec 2018 10:59:22 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hmm, this gets me thinking... We were discussing before about doing a line ending conversion in edk2, and let the git gools provide native line endings (as designed). Is this a good opportunity to run a pilot with edk2-test, where much less history will be lost? Regards, Leif On Fri, Dec 14, 2018 at 07:12:31AM +0000, Jin, Eric wrote: > Hello Supreeth, > > I use "Apply Patch Serial" operation provided by TortoiseGit to do the applying. > The operation is equivalent to "git.exe am --3way --ignore-space-change --keep-cr Fix.patch" > > What is your command to apply patch? > > I observe the same failure with "git.exe am Fix.patch" and "--ignore-space-change " is the key. > I am not sure if it is the mail-patch-conversion cause or not. > > And the patch "[edk2][edk2-test][PATCH v1 1/1] uefi-sct: Change line endings to CR LF. " also has the same failure behavior without "--ignore-space-change " on my side. > > Best Regards > Eric > > -----Original Message----- > From: Supreeth Venkatesh > Sent: Thursday, December 13, 2018 5:07 AM > To: Jin, Eric ; edk2-devel@lists.01.org > Cc: Leif Lindholm > Subject: Re: [edk2-test][Patch] uefi-sct/SctPkg:Correct macro name style in HwErrRecVariable Test > > > Eric, > > Nothing wrong with code. > > However, when applying this patch with git am, I encounter the below errors. (not sure if it is related to mailbox configuration). > Not sure if it is my mailbox, could you please test it on your side using git am and let me know? > > git am > ./patches/0001_SctPkg\:Correct_macro_name_style_in_HwErrRecVariable_Te > st.mbox > Applying: uefi-sct/SctPkg:Correct macro name style in HwErrRecVariable Test > error: patch failed: uefi- > sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxT > est/VariableServicesBBTestMain.h:131 > error: uefi- > sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxT > est/VariableServicesBBTestMain.h: patch does not apply > error: patch failed: uefi- > sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxT > est/VariableServicesBBTestFunction.c:2855 > error: uefi- > sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxT > est/VariableServicesBBTestFunction.c: patch does not apply Patch failed at 0001 uefi-sct/SctPkg:Correct macro name style in HwErrRecVariable Test Use 'git am --show-current-patch' to see the failed patch When you have resolved this problem, run "git am --continue". > If you prefer to skip this patch, run "git am --skip" instead. > To restore the original branch and stop patching, run "git am --abort". > > Thanks, > Supreeth > On Wed, 2018-12-12 at 11:32 +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/BlackBo > > xTest/VariableServicesBBTestMain.h | 6 +++--- > > uefi- > > sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBo > > xTest/VariableServicesBBTestFunction.c | 22 +++++++++++----------- > > 2 files changed, 14 insertions(+), 14 deletions(-) > > > > diff --git a/uefi- > > sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBo > > xTest/VariableServicesBBTestMain.h b/uefi- > > sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBo > > xTest/VariableServicesBBTestMain.h > > index 426b762..7eaa56d 100644 > > --- a/uefi- > > sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBo > > xTest/VariableServicesBBTestMain.h > > +++ b/uefi- > > sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBo > > xTest/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/BlackBo > > xTest/VariableServicesBBTestFunction.c b/uefi- > > sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBo > > xTest/VariableServicesBBTestFunction.c > > index a016476..015a78a 100644 > > --- a/uefi- > > sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBo > > xTest/VariableServicesBBTestFunction.c > > +++ b/uefi- > > sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBo > > xTest/VariableServicesBBTestFunction.c > > @@ -2855,7 +2855,7 @@ HardwareErrorRecordFuncTest ( > > UINT64 RemainingVariableStorageSize; > > UINT64 MaximumVariableSize; > > > > - CHAR16 HwErrRecVariableName[HwErrRecVariableNameLen > > gth]; > > + CHAR16 HwErrRecVariableName[HW_ERR_REC_VARIABLE_NAM > > E_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, >