[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <46DlGj1KgTz9sPQ@ozlabs.org>
Date: Thu, 22 Aug 2019 23:09:00 +1000 (AEST)
From: Michael Ellerman <patch-notifications@...erman.id.au>
To: Christophe Leroy <christophe.leroy@....fr>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>
Cc: linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] powerpc/futex: fix warning: 'oldval' may be used uninitialized in this function
On Wed, 2019-08-14 at 09:25:52 UTC, Christophe Leroy wrote:
> CC kernel/futex.o
> kernel/futex.c: In function 'do_futex':
> kernel/futex.c:1676:17: warning: 'oldval' may be used uninitialized in this function [-Wmaybe-uninitialized]
> return oldval == cmparg;
> ^
> kernel/futex.c:1651:6: note: 'oldval' was declared here
> int oldval, ret;
> ^
>
> This is because arch_futex_atomic_op_inuser() only sets *oval
> if ret is NUL and GCC doesn't see that it will use it only when
> ret is NUL.
>
> Anyway, the non-NUL ret path is an error path that won't suffer from
> setting *oval, and as *oval is a local var in futex_atomic_op_inuser()
> it will have no impact.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@....fr>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/38a0d0cdb46d3f91534e5b9839ec2d67be14c59d
cheers
Powered by blists - more mailing lists