Message ID | 20161026190504.9888-42-lersek@redhat.com |
---|---|
State | Accepted |
Commit | cb4669e05132a6069cdfc1056e03190732b714a0 |
Headers | show |
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> >-----Original Message----- >From: Laszlo Ersek [mailto:lersek@redhat.com] >Sent: Thursday, October 27, 2016 3:05 AM >To: edk2-devel-01 <edk2-devel@ml01.01.org> >Cc: Carsey, Jaben <jaben.carsey@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com> >Subject: [PATCH 41/47] ShellPkg/UefiDpLib: rebase to ARRAY_SIZE() > >Cc: Jaben Carsey <jaben.carsey@intel.com> >Cc: Ruiyu Ni <ruiyu.ni@intel.com> >Contributed-under: TianoCore Contribution Agreement 1.0 >Signed-off-by: Laszlo Ersek <lersek@redhat.com> >--- > ShellPkg/Library/UefiDpLib/DpTrace.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > >diff --git a/ShellPkg/Library/UefiDpLib/DpTrace.c b/ShellPkg/Library/UefiDpLib/DpTrace.c >index f3f781fdb989..eca2ef309bbc 100644 >--- a/ShellPkg/Library/UefiDpLib/DpTrace.c >+++ b/ShellPkg/Library/UefiDpLib/DpTrace.c >@@ -220,8 +220,8 @@ DumpAllTrace( > ++Count; // Count the number of records printed > > // If Handle is non-zero, see if we can determine a name for the driver >- AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, sizeof (mGaugeString) / sizeof (mGaugeString[0])); // >Use Module by default >- AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0])); >+ AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, ARRAY_SIZE (mGaugeString)); // Use Module by >default >+ AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, ARRAY_SIZE (mUnicodeToken)); > if (Measurement.Handle != NULL) { > // See if the Handle is in the HandleBuffer > for (TIndex = 0; TIndex < HandleCount; TIndex++) { >@@ -595,7 +595,7 @@ ProcessHandles( > continue; > } > mGaugeString[0] = 0; // Empty driver name by default >- AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0])); >+ AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, ARRAY_SIZE (mUnicodeToken)); > // See if the Handle is in the HandleBuffer > for (Index = 0; Index < HandleCount; Index++) { > if (Measurement.Handle == HandleBuffer[Index]) { >@@ -776,8 +776,8 @@ ProcessGlobal( > &Measurement.EndTimeStamp, > &Measurement.Identifier)) != 0) > { >- AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, sizeof (mGaugeString) / sizeof (mGaugeString[0])); >- AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0])); >+ AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, ARRAY_SIZE (mGaugeString)); >+ AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, ARRAY_SIZE (mUnicodeToken)); > mGaugeString[25] = 0; > mUnicodeToken[31] = 0; > if ( ! ( IsPhase( &Measurement) || >-- >2.9.2 > _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
diff --git a/ShellPkg/Library/UefiDpLib/DpTrace.c b/ShellPkg/Library/UefiDpLib/DpTrace.c index f3f781fdb989..eca2ef309bbc 100644 --- a/ShellPkg/Library/UefiDpLib/DpTrace.c +++ b/ShellPkg/Library/UefiDpLib/DpTrace.c @@ -220,8 +220,8 @@ DumpAllTrace( ++Count; // Count the number of records printed // If Handle is non-zero, see if we can determine a name for the driver - AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, sizeof (mGaugeString) / sizeof (mGaugeString[0])); // Use Module by default - AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0])); + AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, ARRAY_SIZE (mGaugeString)); // Use Module by default + AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, ARRAY_SIZE (mUnicodeToken)); if (Measurement.Handle != NULL) { // See if the Handle is in the HandleBuffer for (TIndex = 0; TIndex < HandleCount; TIndex++) { @@ -595,7 +595,7 @@ ProcessHandles( continue; } mGaugeString[0] = 0; // Empty driver name by default - AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0])); + AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, ARRAY_SIZE (mUnicodeToken)); // See if the Handle is in the HandleBuffer for (Index = 0; Index < HandleCount; Index++) { if (Measurement.Handle == HandleBuffer[Index]) { @@ -776,8 +776,8 @@ ProcessGlobal( &Measurement.EndTimeStamp, &Measurement.Identifier)) != 0) { - AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, sizeof (mGaugeString) / sizeof (mGaugeString[0])); - AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0])); + AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, ARRAY_SIZE (mGaugeString)); + AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, ARRAY_SIZE (mUnicodeToken)); mGaugeString[25] = 0; mUnicodeToken[31] = 0; if ( ! ( IsPhase( &Measurement) ||
Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> --- ShellPkg/Library/UefiDpLib/DpTrace.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.9.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel