mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kselftest/arm64: Fix uninitialized variable warning in FPMR test
@ 2025-02-07 11:06 Breno Leitao
  2025-02-07 17:26 ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Breno Leitao @ 2025-02-07 11:06 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Shuah Khan
  Cc: linux-arm-kernel, linux-kselftest, linux-kernel, broonie, Breno Leitao

Fix compiler warning about potentially uninitialized orig_fpmr variable:

	testcases/fpmr_siginfo.c: In function ‘fpmr_present’:
	testcases/fpmr_siginfo.c:68:25: warning: ‘orig_fpmr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
	                         fprintf(stderr, "FPMR in frame is %llx, was %llx\n",
	                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	                                 fpmr_ctx->fpmr, orig_fpmr);
	                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~

Initialize orig_fpmr to 0 to resolve the warning.

Signed-off-by: Breno Leitao <leitao@debian.org>
---
 tools/testing/selftests/arm64/signal/testcases/fpmr_siginfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/arm64/signal/testcases/fpmr_siginfo.c b/tools/testing/selftests/arm64/signal/testcases/fpmr_siginfo.c
index e9d24685e74194fc4ed1aebdcfd4c6edd3488e1b..26818860b223d367955d96e12d423fadc304700b 100644
--- a/tools/testing/selftests/arm64/signal/testcases/fpmr_siginfo.c
+++ b/tools/testing/selftests/arm64/signal/testcases/fpmr_siginfo.c
@@ -40,10 +40,10 @@ int fpmr_present(struct tdescr *td, siginfo_t *si, ucontext_t *uc)
 {
 	struct _aarch64_ctx *head = GET_BUF_RESV_HEAD(context);
 	struct fpmr_context *fpmr_ctx;
+	__u64 orig_fpmr = 0;
 	size_t offset;
 	bool in_sigframe;
 	bool have_fpmr;
-	__u64 orig_fpmr;
 
 	have_fpmr = getauxval(AT_HWCAP2) & HWCAP2_FPMR;
 	if (have_fpmr)

---
base-commit: 0d5248724ed8bc68c867c4c65dda625277f68fbc
change-id: 20250207-arm_fix_selftest-ee29dbc33a06

Best regards,
-- 
Breno Leitao <leitao@debian.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-02-07 19:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-07 11:06 [PATCH] kselftest/arm64: Fix uninitialized variable warning in FPMR test Breno Leitao
2025-02-07 17:26 ` Mark Brown
2025-02-07 18:45   ` Breno Leitao
2025-02-07 19:04     ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®