mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Shuah Khan <shuah@kernel.org>,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests/arm64: Prevent build warnings from -Wmaybe-uninitialized
Date: Wed, 25 Jun 2025 11:24:30 +0100	[thread overview]
Message-ID: <dd3dee5a-b030-4658-8cef-c777928368d4@sirena.org.uk> (raw)
In-Reply-To: <20250625020138.3777454-1-anshuman.khandual@arm.com>

[-- Attachment #1: Type: text/plain, Size: 567 bytes --]

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?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2025-06-25 10:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-25  2:01 Anshuman Khandual
2025-06-25 10:24 ` Mark Brown [this message]
2025-06-27 10:45   ` Anshuman Khandual
2025-06-27 10:55     ` Mark Brown
2025-07-07 13:10 ` Thomas Weißschuh

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-all 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=dd3dee5a-b030-4658-8cef-c777928368d4@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=anshuman.khandual@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=will@kernel.org \
    /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

all inboxes | Powered by JetHome®