From: Will Deacon <will@kernel.org>
To: trix@redhat.com
Cc: peterz@infradead.org, mingo@redhat.com, longman@redhat.com,
boqun.feng@gmail.com, nathan@kernel.org, ndesaulniers@google.com,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH] locking/ww_mutex: set ret variable on failure
Date: Mon, 11 Oct 2021 12:16:11 +0100 [thread overview]
Message-ID: <20211011111610.GD4068@willie-the-truck> (raw)
In-Reply-To: <20210927145756.209435-1-trix@redhat.com>
On Mon, Sep 27, 2021 at 07:57:56AM -0700, trix@redhat.com wrote:
> From: Tom Rix <trix@redhat.com>
>
> Building with clang 13 produces this error
> test-ww_mutex.c:138:7: error: variable 'ret' is used
> uninitialized whenever 'if' condition is true
> [-Werror,-Wsometimes-uninitialized]
> if (!ww_mutex_trylock(&mutex, &ctx)) {
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> On this failure set ret to -EINVAL as is similarly done
> in the function.
>
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
> kernel/locking/test-ww_mutex.c | 1 +
> 1 file changed, 1 insertion(+)
Acked-by: Will Deacon <will@kernel.org>
Will
prev parent reply other threads:[~2021-10-11 11:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-27 14:57 trix
2021-10-11 11:16 ` Will Deacon [this message]
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=20211011111610.GD4068@willie-the-truck \
--to=will@kernel.org \
--cc=boqun.feng@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=longman@redhat.com \
--cc=mingo@redhat.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=peterz@infradead.org \
--cc=trix@redhat.com \
/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®