* [PATCH] selftests: arm64: Fix -Waddress warning in tpidr2 test
@ 2025-08-06 20:39 Bala-Vignesh-Reddy
2025-08-07 5:02 ` Anshuman Khandual
2025-08-07 12:04 ` [PATCH] " Mark Brown
0 siblings, 2 replies; 7+ messages in thread
From: Bala-Vignesh-Reddy @ 2025-08-06 20:39 UTC (permalink / raw)
To: linux-arm-kernel, linux-kselftest, linux-kernel
Cc: Bala-Vignesh-Reddy, Catalin Marinas, Will Deacon, Shuah Khan,
Mark Brown, Yeoreum Yun
Resolve compiler warning about always true condition in ksft_test_result
in tpidr2, passing actual function.
This silences -Waddress warning while maintaining test functionality.
Signed-off-by: Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com>
---
tools/testing/selftests/arm64/abi/tpidr2.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/arm64/abi/tpidr2.c b/tools/testing/selftests/arm64/abi/tpidr2.c
index f58a9f89b952..4c89ab0f1010 100644
--- a/tools/testing/selftests/arm64/abi/tpidr2.c
+++ b/tools/testing/selftests/arm64/abi/tpidr2.c
@@ -227,10 +227,10 @@ int main(int argc, char **argv)
ret = open("/proc/sys/abi/sme_default_vector_length", O_RDONLY, 0);
if (ret >= 0) {
ksft_test_result(default_value(), "default_value\n");
- ksft_test_result(write_read, "write_read\n");
- ksft_test_result(write_sleep_read, "write_sleep_read\n");
- ksft_test_result(write_fork_read, "write_fork_read\n");
- ksft_test_result(write_clone_read, "write_clone_read\n");
+ ksft_test_result(write_read(), "write_read\n");
+ ksft_test_result(write_sleep_read(), "write_sleep_read\n");
+ ksft_test_result(write_fork_read(), "write_fork_read\n");
+ ksft_test_result(write_clone_read(), "write_clone_read\n");
} else {
ksft_print_msg("SME support not present\n");
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] selftests: arm64: Fix -Waddress warning in tpidr2 test
2025-08-06 20:39 [PATCH] selftests: arm64: Fix -Waddress warning in tpidr2 test Bala-Vignesh-Reddy
@ 2025-08-07 5:02 ` Anshuman Khandual
2025-08-07 11:42 ` Bala-Vignesh-Reddy
2025-08-07 12:04 ` [PATCH] " Mark Brown
1 sibling, 1 reply; 7+ messages in thread
From: Anshuman Khandual @ 2025-08-07 5:02 UTC (permalink / raw)
To: Bala-Vignesh-Reddy, linux-arm-kernel, linux-kselftest,
linux-kernel
Cc: Catalin Marinas, Will Deacon, Shuah Khan, Mark Brown, Yeoreum Yun
On 07/08/25 2:09 AM, Bala-Vignesh-Reddy wrote:
> Resolve compiler warning about always true condition in ksft_test_result
> in tpidr2, passing actual function.
>
> This silences -Waddress warning while maintaining test functionality.
Might be better to just add the compiler warning in the commit message.
Also does it need a Fixes: tag for the relevant commit as well ?
6d80cb73131d ("kselftest/arm64: Convert tpidr2 test to use kselftest.h")
>
> Signed-off-by: Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com>
> ---
> tools/testing/selftests/arm64/abi/tpidr2.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tools/testing/selftests/arm64/abi/tpidr2.c b/tools/testing/selftests/arm64/abi/tpidr2.c
> index f58a9f89b952..4c89ab0f1010 100644
> --- a/tools/testing/selftests/arm64/abi/tpidr2.c
> +++ b/tools/testing/selftests/arm64/abi/tpidr2.c
> @@ -227,10 +227,10 @@ int main(int argc, char **argv)
> ret = open("/proc/sys/abi/sme_default_vector_length", O_RDONLY, 0);
> if (ret >= 0) {
> ksft_test_result(default_value(), "default_value\n");
> - ksft_test_result(write_read, "write_read\n");
> - ksft_test_result(write_sleep_read, "write_sleep_read\n");
> - ksft_test_result(write_fork_read, "write_fork_read\n");
> - ksft_test_result(write_clone_read, "write_clone_read\n");
> + ksft_test_result(write_read(), "write_read\n");
> + ksft_test_result(write_sleep_read(), "write_sleep_read\n");
> + ksft_test_result(write_fork_read(), "write_fork_read\n");
> + ksft_test_result(write_clone_read(), "write_clone_read\n");
>
> } else {
> ksft_print_msg("SME support not present\n");Otherwise LGTM.
^ permalink raw reply [flat|nested] 7+ messages in thread
* (no subject)
2025-08-07 5:02 ` Anshuman Khandual
@ 2025-08-07 11:42 ` Bala-Vignesh-Reddy
2025-08-07 11:42 ` [PATCH v2] selftests: arm64: Fix -Waddress warning in tpidr2 test Bala-Vignesh-Reddy
0 siblings, 1 reply; 7+ messages in thread
From: Bala-Vignesh-Reddy @ 2025-08-07 11:42 UTC (permalink / raw)
To: anshuman.khandual
Cc: linux-arm-kernel, linux-kselftest, linux-kernel, catalin.marinas,
will, shuah, broonie, yeoreum.yun
Hi Anshuman,
Thanks for the feedback. I've added the warning text to the commit message
and included the Fixes tag as suggested.
Patch v2 attached.
Best Regards,
Bala Vignesh Reddy
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2] selftests: arm64: Fix -Waddress warning in tpidr2 test
2025-08-07 11:42 ` Bala-Vignesh-Reddy
@ 2025-08-07 11:42 ` Bala-Vignesh-Reddy
2025-08-07 12:07 ` Mark Brown
2025-08-14 5:47 ` Anshuman Khandual
0 siblings, 2 replies; 7+ messages in thread
From: Bala-Vignesh-Reddy @ 2025-08-07 11:42 UTC (permalink / raw)
To: anshuman.khandual
Cc: linux-arm-kernel, linux-kselftest, linux-kernel, catalin.marinas,
will, shuah, broonie, yeoreum.yun, Bala-Vignesh-Reddy
Resolve compiler warning about always true condition in ksft_test_result
in tpidr2, passing actual function.
This silences -Waddress warning while maintaining test functionality.
Fixes compiler warning (similar for other functions):
warning: the address of 'write_read' will always evaluate as
'true' [-Waddress]
Fixes: 6d80cb73131d ("kselftest/arm64: Convert tpidr2 test to use kselftest.h")
Signed-off-by: Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com>
---
tools/testing/selftests/arm64/abi/tpidr2.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/arm64/abi/tpidr2.c b/tools/testing/selftests/arm64/abi/tpidr2.c
index f58a9f89b952..4c89ab0f1010 100644
--- a/tools/testing/selftests/arm64/abi/tpidr2.c
+++ b/tools/testing/selftests/arm64/abi/tpidr2.c
@@ -227,10 +227,10 @@ int main(int argc, char **argv)
ret = open("/proc/sys/abi/sme_default_vector_length", O_RDONLY, 0);
if (ret >= 0) {
ksft_test_result(default_value(), "default_value\n");
- ksft_test_result(write_read, "write_read\n");
- ksft_test_result(write_sleep_read, "write_sleep_read\n");
- ksft_test_result(write_fork_read, "write_fork_read\n");
- ksft_test_result(write_clone_read, "write_clone_read\n");
+ ksft_test_result(write_read(), "write_read\n");
+ ksft_test_result(write_sleep_read(), "write_sleep_read\n");
+ ksft_test_result(write_fork_read(), "write_fork_read\n");
+ ksft_test_result(write_clone_read(), "write_clone_read\n");
} else {
ksft_print_msg("SME support not present\n");
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] selftests: arm64: Fix -Waddress warning in tpidr2 test
2025-08-06 20:39 [PATCH] selftests: arm64: Fix -Waddress warning in tpidr2 test Bala-Vignesh-Reddy
2025-08-07 5:02 ` Anshuman Khandual
@ 2025-08-07 12:04 ` Mark Brown
1 sibling, 0 replies; 7+ messages in thread
From: Mark Brown @ 2025-08-07 12:04 UTC (permalink / raw)
To: Bala-Vignesh-Reddy
Cc: linux-arm-kernel, linux-kselftest, linux-kernel, Catalin Marinas,
Will Deacon, Shuah Khan, Yeoreum Yun
[-- Attachment #1: Type: text/plain, Size: 539 bytes --]
On Thu, Aug 07, 2025 at 02:09:26AM +0530, Bala-Vignesh-Reddy wrote:
> Resolve compiler warning about always true condition in ksft_test_result
> in tpidr2, passing actual function.
>
> This silences -Waddress warning while maintaining test functionality.
Ouch, good spot. Annoyingly the compiler I was using didn't complain
about this at all. Like Anshuman said it's good practice to include the
warning, and also often the compiler details unless it's a super common
warning.
Reviewed-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] selftests: arm64: Fix -Waddress warning in tpidr2 test
2025-08-07 11:42 ` [PATCH v2] selftests: arm64: Fix -Waddress warning in tpidr2 test Bala-Vignesh-Reddy
@ 2025-08-07 12:07 ` Mark Brown
2025-08-14 5:47 ` Anshuman Khandual
1 sibling, 0 replies; 7+ messages in thread
From: Mark Brown @ 2025-08-07 12:07 UTC (permalink / raw)
To: Bala-Vignesh-Reddy
Cc: anshuman.khandual, linux-arm-kernel, linux-kselftest,
linux-kernel, catalin.marinas, will, shuah, yeoreum.yun
[-- Attachment #1: Type: text/plain, Size: 347 bytes --]
On Thu, Aug 07, 2025 at 05:12:29PM +0530, Bala-Vignesh-Reddy wrote:
> Resolve compiler warning about always true condition in ksft_test_result
> in tpidr2, passing actual function.
>
> This silences -Waddress warning while maintaining test functionality.
Not just maintaining, it fixes it.
Reviewed-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] selftests: arm64: Fix -Waddress warning in tpidr2 test
2025-08-07 11:42 ` [PATCH v2] selftests: arm64: Fix -Waddress warning in tpidr2 test Bala-Vignesh-Reddy
2025-08-07 12:07 ` Mark Brown
@ 2025-08-14 5:47 ` Anshuman Khandual
1 sibling, 0 replies; 7+ messages in thread
From: Anshuman Khandual @ 2025-08-14 5:47 UTC (permalink / raw)
To: Bala-Vignesh-Reddy
Cc: linux-arm-kernel, linux-kselftest, linux-kernel, catalin.marinas,
will, shuah, broonie, yeoreum.yun
On 07/08/25 5:12 PM, Bala-Vignesh-Reddy wrote:
> Resolve compiler warning about always true condition in ksft_test_result
> in tpidr2, passing actual function.
>
> This silences -Waddress warning while maintaining test functionality.
>
> Fixes compiler warning (similar for other functions):
> warning: the address of 'write_read' will always evaluate as
> 'true' [-Waddress]
>
> Fixes: 6d80cb73131d ("kselftest/arm64: Convert tpidr2 test to use kselftest.h")
>
> Signed-off-by: Bala-Vignesh-Reddy <reddybalavignesh9979@gmail.com>
> ---
> tools/testing/selftests/arm64/abi/tpidr2.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tools/testing/selftests/arm64/abi/tpidr2.c b/tools/testing/selftests/arm64/abi/tpidr2.c
> index f58a9f89b952..4c89ab0f1010 100644
> --- a/tools/testing/selftests/arm64/abi/tpidr2.c
> +++ b/tools/testing/selftests/arm64/abi/tpidr2.c
> @@ -227,10 +227,10 @@ int main(int argc, char **argv)
> ret = open("/proc/sys/abi/sme_default_vector_length", O_RDONLY, 0);
> if (ret >= 0) {
> ksft_test_result(default_value(), "default_value\n");
> - ksft_test_result(write_read, "write_read\n");
> - ksft_test_result(write_sleep_read, "write_sleep_read\n");
> - ksft_test_result(write_fork_read, "write_fork_read\n");
> - ksft_test_result(write_clone_read, "write_clone_read\n");
> + ksft_test_result(write_read(), "write_read\n");
> + ksft_test_result(write_sleep_read(), "write_sleep_read\n");
> + ksft_test_result(write_fork_read(), "write_fork_read\n");
> + ksft_test_result(write_clone_read(), "write_clone_read\n");
>
> } else {
> ksft_print_msg("SME support not present\n");
LGTM
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-08-14 5:47 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-06 20:39 [PATCH] selftests: arm64: Fix -Waddress warning in tpidr2 test Bala-Vignesh-Reddy
2025-08-07 5:02 ` Anshuman Khandual
2025-08-07 11:42 ` Bala-Vignesh-Reddy
2025-08-07 11:42 ` [PATCH v2] selftests: arm64: Fix -Waddress warning in tpidr2 test Bala-Vignesh-Reddy
2025-08-07 12:07 ` Mark Brown
2025-08-14 5:47 ` Anshuman Khandual
2025-08-07 12:04 ` [PATCH] " Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).