* [PATCH edk2-test 1/1] uefi-sct/SctPkg: type mismatch in Simple Network test
@ 2021-03-30 15:03 Heinrich Schuchardt
2021-04-05 14:43 ` G Edhaya Chandran
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Heinrich Schuchardt @ 2021-03-30 15:03 UTC (permalink / raw)
To: EDK II Development
Cc: Eric Jin, G Edhaya Chandran, Barton Gao, Arvin Chen,
Samer El-Haj-Mahmoud, Heinrich Schuchardt
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 | 52 +++++++++----------
1 file changed, 26 insertions(+), 26 deletions(-)
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c
index 8767e68e92d4..5fc01aadd96a 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/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]
);
}
@@ -885,17 +885,17 @@ BBTestReceiveFilterFunctionTest (
AssertionType,
gSimpleNetworkBBTestFunctionAssertionGuid012,
L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke ReceiveFilters() to reset multicast receive filters list and verify interface correctness within test case",
- L"%a:%d:Status - %r, Filter - %x, Mask - %x,Count - %d(%d), Address - %x, %x, %x",
+ L"%a:%d:Status - %r, Filter - %x, Mask - %x, Count - %d(%d), Address - %x, %x, %x",
__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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH edk2-test 1/1] uefi-sct/SctPkg: type mismatch in Simple Network test
2021-03-30 15:03 [PATCH edk2-test 1/1] uefi-sct/SctPkg: type mismatch in Simple Network test Heinrich Schuchardt
@ 2021-04-05 14:43 ` G Edhaya Chandran
2021-05-09 17:09 ` Samer El-Haj-Mahmoud
2021-05-12 9:53 ` Sunny Wang
2 siblings, 0 replies; 5+ messages in thread
From: G Edhaya Chandran @ 2021-04-05 14:43 UTC (permalink / raw)
To: Heinrich Schuchardt, EDK II Development
Cc: Eric Jin, Barton Gao, Arvin Chen, Samer El-Haj-Mahmoud
Reviewed-by: G Edhaya Chandran<edhaya.chandran@arm.com>
> -----Original Message-----
> From: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Sent: 30 March 2021 20:34
> 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: type mismatch in Simple
> Network test
>
> 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 | 52 +++++++++----------
> 1 file changed, 26 insertions(+), 26 deletions(-)
>
> diff --git a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNe
> tworkBBTestFunction.c b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNe
> tworkBBTestFunction.c
> index 8767e68e92d4..5fc01aadd96a 100644
> --- a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNe
> tworkBBTestFunction.c
> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxT
> +++ est/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]
> );
> }
>
> @@ -885,17 +885,17 @@ BBTestReceiveFilterFunctionTest (
> AssertionType,
> gSimpleNetworkBBTestFunctionAssertionGuid012,
> L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke
> ReceiveFilters() to reset multicast receive filters list and verify interface
> correctness within test case",
> - L"%a:%d:Status - %r, Filter - %x, Mask - %x,Count - %d(%d), Address -
> %x, %x, %x",
> + L"%a:%d:Status - %r, Filter - %x, Mask - %x, Count -
> + %d(%d), Address - %x, %x, %x",
> __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
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH edk2-test 1/1] uefi-sct/SctPkg: type mismatch in Simple Network test
2021-03-30 15:03 [PATCH edk2-test 1/1] uefi-sct/SctPkg: type mismatch in Simple Network test Heinrich Schuchardt
2021-04-05 14:43 ` G Edhaya Chandran
@ 2021-05-09 17:09 ` Samer El-Haj-Mahmoud
2021-05-12 7:33 ` [edk2-devel] " G Edhaya Chandran
2021-05-12 9:53 ` Sunny Wang
2 siblings, 1 reply; 5+ messages in thread
From: Samer El-Haj-Mahmoud @ 2021-05-09 17:09 UTC (permalink / raw)
To: Heinrich Schuchardt, EDK II Development
Cc: Eric Jin, G Edhaya Chandran, Barton Gao, Arvin Chen,
Samer El-Haj-Mahmoud
Reviewed-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
> -----Original Message-----
> From: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Sent: Tuesday, March 30, 2021 11:04 AM
> 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: type mismatch in Simple
> Network test
>
> 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 | 52 +++++++++----------
> 1 file changed, 26 insertions(+), 26 deletions(-)
>
> diff --git a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Simpl
> eNetworkBBTestFunction.c b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Simpl
> eNetworkBBTestFunction.c
> index 8767e68e92d4..5fc01aadd96a 100644
> --- a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/Simpl
> eNetworkBBTestFunction.c
> +++ b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxT
> +++ est/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]
> );
> }
>
> @@ -885,17 +885,17 @@ BBTestReceiveFilterFunctionTest (
> AssertionType,
> gSimpleNetworkBBTestFunctionAssertionGuid012,
> L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke
> ReceiveFilters() to reset multicast receive filters list and verify interface
> correctness within test case",
> - L"%a:%d:Status - %r, Filter - %x, Mask - %x,Count - %d(%d),
> Address - %x, %x, %x",
> + L"%a:%d:Status - %r, Filter - %x, Mask - %x, Count -
> + %d(%d), Address - %x, %x, %x",
> __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
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [edk2-devel] [PATCH edk2-test 1/1] uefi-sct/SctPkg: type mismatch in Simple Network test
2021-05-09 17:09 ` Samer El-Haj-Mahmoud
@ 2021-05-12 7:33 ` G Edhaya Chandran
0 siblings, 0 replies; 5+ messages in thread
From: G Edhaya Chandran @ 2021-05-12 7:33 UTC (permalink / raw)
To: Samer El-Haj-Mahmoud, devel
[-- Attachment #1: Type: text/plain, Size: 253 bytes --]
On Sun, May 9, 2021 at 10:40 PM, Samer El-Haj-Mahmoud wrote:
>
> Reviewed-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Upstreamed by commit-id : https://github.com/tianocore/edk2-test/commit/3c9b20bee2d8610b9a88acb5ae7f9255b0140a67
[-- Attachment #2: Type: text/html, Size: 296 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [edk2-devel] [PATCH edk2-test 1/1] uefi-sct/SctPkg: type mismatch in Simple Network test
2021-03-30 15:03 [PATCH edk2-test 1/1] uefi-sct/SctPkg: type mismatch in Simple Network test Heinrich Schuchardt
2021-04-05 14:43 ` G Edhaya Chandran
2021-05-09 17:09 ` Samer El-Haj-Mahmoud
@ 2021-05-12 9:53 ` Sunny Wang
2 siblings, 0 replies; 5+ messages in thread
From: Sunny Wang @ 2021-05-12 9:53 UTC (permalink / raw)
To: devel@edk2.groups.io, xypron.glpk@gmx.de
Cc: Eric Jin, G Edhaya Chandran, Barton Gao, Arvin Chen,
Samer El-Haj-Mahmoud, Sunny Wang
Looks good to me. I'm just curious if we would run into a similar problem with using Print() in MdePkg\Library\UefiLib\UefiLibPrint.c or ShellPrintEx() in ShellPkg\Library\UefiShellLib\UefiShellLib.c. If not, we may need to improve SctPrint().
Reviewed-by: Sunny Wang <sunny.wang@arm.com>
-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Heinrich Schuchardt via groups.io
Sent: Tuesday, March 30, 2021 11:04 PM
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: [edk2-devel] [PATCH edk2-test 1/1] uefi-sct/SctPkg: type mismatch in Simple Network test
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 | 52 +++++++++----------
1 file changed, 26 insertions(+), 26 deletions(-)
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c
index 8767e68e92d4..5fc01aadd96a 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxT
+++ est/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]
);
}
@@ -885,17 +885,17 @@ BBTestReceiveFilterFunctionTest (
AssertionType,
gSimpleNetworkBBTestFunctionAssertionGuid012,
L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke ReceiveFilters() to reset multicast receive filters list and verify interface correctness within test case",
- L"%a:%d:Status - %r, Filter - %x, Mask - %x,Count - %d(%d), Address - %x, %x, %x",
+ L"%a:%d:Status - %r, Filter - %x, Mask - %x, Count -
+ %d(%d), Address - %x, %x, %x",
__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
-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#73534): https://edk2.groups.io/g/devel/message/73534
Mute This Topic: https://groups.io/mt/81724187/5985097
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [Sunny.Wang@arm.com] -=-=-=-=-=-=
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-05-12 9:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-30 15:03 [PATCH edk2-test 1/1] uefi-sct/SctPkg: type mismatch in Simple Network test Heinrich Schuchardt
2021-04-05 14:43 ` G Edhaya Chandran
2021-05-09 17:09 ` Samer El-Haj-Mahmoud
2021-05-12 7:33 ` [edk2-devel] " G Edhaya Chandran
2021-05-12 9:53 ` Sunny Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox