[PATCH] selftests/arm64: Prevent build warnings from -Wmaybe-uninitialized
Mark Brown
broonie at kernel.org
Wed Jun 25 03:24:30 PDT 2025
On Wed, Jun 25, 2025 at 03:01:38AM +0100, Anshuman Khandual wrote:
> @@ -96,7 +96,7 @@ static int write_sleep_read(void)
> static int write_fork_read(void)
> {
> pid_t newpid, waiting, oldpid;
> - int status;
> + int status = 0;
>
> set_tpidr2(getpid());
>
This will shut the warnings up, but it's a bit of a heavy hammer that
means that the warning can never trigger warnings for that variable
being unused. Is it possible to fix this by updating the control flow
such that the compiler can tell that the initialisation follows the use?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20250625/a73d5a41/attachment.sig>
More information about the linux-arm-kernel
mailing list