From: Alexei Fedorov <Alexei.Fedorov@arm.com>
To: Dandan Bi <dandan.bi@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>, Jaben Carsey <jaben.carsey@intel.com>
Subject: Re: [patch 3/4] ShellPkg/UefiShellAcpiViewCommandLib: Fix VS build failure
Date: Mon, 30 Jul 2018 08:27:51 +0000 [thread overview]
Message-ID: <HE1PR08MB1162722FE8C2D83B888F55EE9A2F0@HE1PR08MB1162.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <20180730022703.101708-4-dandan.bi@intel.com>
Dandan,
What is the reason for providing this patch addressing the same issues which were fixed by already reviewed patch sent on 13 July?
See thread for
https://lists.01.org/pipermail/edk2-devel/2018-July/027139.html
Alexei
________________________________
From: Dandan Bi <dandan.bi@intel.com>
Sent: 30 July 2018 03:27:02
To: edk2-devel@lists.01.org
Cc: Alexei Fedorov; Ruiyu Ni; Jaben Carsey
Subject: [patch 3/4] ShellPkg/UefiShellAcpiViewCommandLib: Fix VS build failure
Fix following warnings:
1.
xxx\GtdtParser.c(179): warning C4244:
'=': conversion from 'UINT32' to 'UINT16', possible loss of data
xxx\GtdtParser.c(180): warning C4244:
'-=': conversion from 'UINT32' to 'UINT16', possible loss of data
xxx\GtdtParser.c(196): warning C4244:
'-=': conversion from 'UINT32' to 'UINT16', possible loss of data
2.
xxx\XsdtParser.c(99): warning C4457:
declaration of 'Ptr' hides function parameter
cc: Alexei Fedorov <Alexei.Fedorov@arm.com>
cc: Ruiyu Ni <ruiyu.ni@intel.com>
cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
.../UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c | 6 +++---
.../UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c | 12 ++++++------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c
index 3a3cee948a..d5671081da 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c
@@ -174,12 +174,12 @@ DumpGTBlock (
"GT Block",
Ptr,
Length,
PARSER_PARAMS (GtBlockParser)
);
- GTBlockTimerLength = (*GtBlockLength - Offset) / (*GtBlockTimerCount);
- Length -= Offset;
+ GTBlockTimerLength = (*GtBlockLength - (UINT16)Offset) / (UINT16)(*GtBlockTimerCount);
+ Length -= (UINT16)Offset;
if (*GtBlockTimerCount != 0) {
Ptr += (*GtBlockTimerOffset);
Index = 0;
while ((Index < (*GtBlockTimerCount)) && (Length >= GTBlockTimerLength)) {
@@ -191,11 +191,11 @@ DumpGTBlock (
GTBlockTimerLength,
PARSER_PARAMS (GtBlockTimerParser)
);
// Increment by GT Block Timer structure size
Ptr += Offset;
- Length -= Offset;
+ Length -= (UINT16)Offset;
Index++;
}
if (Length != 0) {
IncrementErrorCount ();
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c
index 99521cd67a..341a61b8fb 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c
@@ -63,10 +63,11 @@ ParseAcpiXsdt (
UINT32 Offset;
UINT32 TableOffset;
UINT64* TablePointer;
UINTN EntryIndex;
CHAR16 Buffer[32];
+ UINT8* Pointer;
// Parse the ACPI header to get the length
ParseAcpi (
FALSE,
0,
@@ -94,30 +95,29 @@ ParseAcpiXsdt (
CONST UINT32* Signature;
CONST UINT32* Length;
CONST UINT8* Revision;
if ((UINT64*)(UINTN)(*TablePointer) != NULL) {
- UINT8* Ptr;
ParseAcpiHeader (
(UINT8*)(UINTN)(*TablePointer),
&Signature,
&Length,
&Revision
);
- Ptr = (UINT8*)Signature;
+ Pointer = (UINT8*)Signature;
UnicodeSPrint (
Buffer,
sizeof (Buffer),
L"Entry[%d] - %c%c%c%c",
EntryIndex++,
- Ptr[0],
- Ptr[1],
- Ptr[2],
- Ptr[3]
+ Pointer[0],
+ Pointer[1],
+ Pointer[2],
+ Pointer[3]
);
} else {
UnicodeSPrint (
Buffer,
sizeof (Buffer),
--
2.14.3.windows.1
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
next prev parent reply other threads:[~2018-07-30 8:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-30 2:26 [patch 0/4] ShellPkg/UefiShellAcpiViewCommandLib: Fix build issues Dandan Bi
2018-07-30 2:27 ` [patch 1/4] ShellPkg/UefiShellAcpiViewCommandLib: Fix VS2012 build failure Dandan Bi
2018-07-30 17:46 ` Carsey, Jaben
2018-07-30 2:27 ` [patch 2/4] " Dandan Bi
2018-07-30 17:46 ` Carsey, Jaben
2018-07-30 2:27 ` [patch 3/4] ShellPkg/UefiShellAcpiViewCommandLib: Fix VS " Dandan Bi
2018-07-30 8:27 ` Alexei Fedorov [this message]
2018-07-30 8:49 ` Bi, Dandan
2018-07-30 2:27 ` [patch 4/4] ShellPkg/UefiShellAcpiViewCommandLib: Fix GCC " Dandan Bi
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=HE1PR08MB1162722FE8C2D83B888F55EE9A2F0@HE1PR08MB1162.eurprd08.prod.outlook.com \
--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