From: "Heinrich Schuchardt" <xypron.glpk@gmx.de>
To: EDK II Development <devel@edk2.groups.io>
Cc: Eric Jin <eric.jin@intel.com>,
G Edhaya Chandran <Edhaya.Chandran@arm.com>,
Barton Gao <gaojie@byosoft.com.cn>,
Arvin Chen <arvinx.chen@intel.com>,
Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>,
Heinrich Schuchardt <xypron.glpk@gmx.de>
Subject: [PATCH edk2-test 1/1] uefi-sct/SctPkg: IHV: type mismatch in Simple Network test
Date: Mon, 22 Mar 2021 12:36:05 +0100 [thread overview]
Message-ID: <20210322113605.43169-1-xypron.glpk@gmx.de> (raw)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3257
SctPrint() requires that %x and %d refers to an UINTN parameter.
SimpleNetworkBBTestFunction.c tries to print INT32 using %x, %d without
converting to UINTN resulting in corrupted output like:
SimpleNetworkBBTestFunction.c:891:
Status - Unsupported, Filter - AAAA00000000
Mode->ReceiveFilterSetting has only 32 bit. The true value is 0.
Convert the parameters to UINTN.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
.../SimpleNetworkBBTestFunction.c | 50 +++++++++----------
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c
index ca15df6303f6..06ad3163ef6b 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c
@@ -775,7 +775,7 @@ BBTestReceiveFilterFunctionTest (
__FILE__,
(UINTN)__LINE__,
Status,
- SnpInterface->Mode->ReceiveFilterSetting
+ (UINTN)SnpInterface->Mode->ReceiveFilterSetting
);
// Check point A. Enable Specified bit.
@@ -797,7 +797,7 @@ BBTestReceiveFilterFunctionTest (
__FILE__,
(UINTN)__LINE__,
Status,
- SnpInterface->Mode->ReceiveFilterSetting
+ (UINTN)SnpInterface->Mode->ReceiveFilterSetting
);
// Check point C. Enable and Disable Specified bit together.
@@ -819,7 +819,7 @@ BBTestReceiveFilterFunctionTest (
__FILE__,
(UINTN)__LINE__,
Status,
- SnpInterface->Mode->ReceiveFilterSetting
+ (UINTN)SnpInterface->Mode->ReceiveFilterSetting
);
}
@@ -856,12 +856,12 @@ BBTestReceiveFilterFunctionTest (
__FILE__,
(UINTN)__LINE__,
Status,
- SnpInterface->Mode->ReceiveFilterSetting,
- SnpInterface->Mode->ReceiveFilterMask,
- SnpInterface->Mode->MCastFilterCount,
- SnpInterface->Mode->MCastFilter[0].Addr[0],
- SnpInterface->Mode->MCastFilter[0].Addr[5],
- SnpInterface->Mode->MCastFilter[1].Addr[0]
+ (UINTN)SnpInterface->Mode->ReceiveFilterSetting,
+ (UINTN)SnpInterface->Mode->ReceiveFilterMask,
+ (UINTN)SnpInterface->Mode->MCastFilterCount,
+ (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[0],
+ (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[5],
+ (UINTN)SnpInterface->Mode->MCastFilter[1].Addr[0]
);
}
@@ -889,13 +889,13 @@ BBTestReceiveFilterFunctionTest (
__FILE__,
(UINTN)__LINE__,
Status,
- SnpInterface->Mode->ReceiveFilterSetting,
- SnpInterface->Mode->ReceiveFilterMask,
- SnpInterface->Mode->MCastFilterCount,
- Mode.MCastFilterCount,
- SnpInterface->Mode->MCastFilter[0].Addr[0],
- SnpInterface->Mode->MCastFilter[0].Addr[5],
- SnpInterface->Mode->MCastFilter[1].Addr[0]
+ (UINTN)SnpInterface->Mode->ReceiveFilterSetting,
+ (UINTN)SnpInterface->Mode->ReceiveFilterMask,
+ (UINTN)SnpInterface->Mode->MCastFilterCount,
+ (UINTN)Mode.MCastFilterCount,
+ (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[0],
+ (UINTN)SnpInterface->Mode->MCastFilter[0].Addr[5],
+ (UINTN)SnpInterface->Mode->MCastFilter[1].Addr[0]
);
//
// Restore SNP State
@@ -1358,12 +1358,12 @@ BBTestMCastIpToMacFunctionTest (
__FILE__,
(UINTN)__LINE__,
Status,
- MAC1.Addr[0],
- MAC1.Addr[1],
- MAC1.Addr[2],
- MAC1.Addr[3],
- MAC1.Addr[4],
- MAC1.Addr[5]
+ (UINTN)MAC1.Addr[0],
+ (UINTN)MAC1.Addr[1],
+ (UINTN)MAC1.Addr[2],
+ (UINTN)MAC1.Addr[3],
+ (UINTN)MAC1.Addr[4],
+ (UINTN)MAC1.Addr[5]
);
//
@@ -1510,8 +1510,8 @@ BBTestNVDataFunctionTest (
__FILE__,
(UINTN)__LINE__,
Status,
- SnpInterface->Mode->NvRamSize,
- SnpInterface->Mode->NvRamAccessSize
+ (UINTN)SnpInterface->Mode->NvRamSize,
+ (UINTN)SnpInterface->Mode->NvRamAccessSize
);
}
@@ -1919,7 +1919,7 @@ BBTestGetStatusFunctionTest (
(UINTN)__LINE__,
Status,
Status1,
- InterruptStatus
+ (UINTN)InterruptStatus
);
}
--
2.30.2
next reply other threads:[~2021-03-22 11:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-22 11:36 Heinrich Schuchardt [this message]
2021-05-12 9:57 ` [edk2-devel] [PATCH edk2-test 1/1] uefi-sct/SctPkg: IHV: type mismatch in Simple Network test Sunny Wang
2021-06-08 12:36 ` G Edhaya Chandran
2021-06-08 12:41 ` G Edhaya Chandran
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=20210322113605.43169-1-xypron.glpk@gmx.de \
--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