Re: [PATCH 4/4] futex: warning corrections

From: Vitaliy Ivanov
Date: Wed Jul 06 2011 - 17:11:20 EST


On Wed, 2011-07-06 at 10:00 -0700, Darren Hart wrote:
> On 07/04/2011 04:21 PM, Vitaliy Ivanov wrote:
> > From 3f7997d71fe2b5cb16e2913928f68023855d786d Mon Sep 17 00:00:00 2001
> > From: Vitaliy Ivanov <vitalivanov@xxxxxxxxx>
> > Date: Tue, 5 Jul 2011 02:07:42 +0300
> > Subject: [PATCH 4/4] futex: warning corrections
> Hi Vitaliy,
>
> Thanks for looking to fix these warnings. Note that the compiler isn't
> always aware of some of the subtleties involved with things like
> cmpxchg. In cases where it thinks there may be an uninitialized usage,
> be sure to confirm it is possible before adding the overhead of an
> assignment to a hot path.
>
> None of these assignments are necessary. Consider using __maybe_unused
> instead.

Darren,

Actually unused and uninitialized are different issues. __maybe_unused won't help in this case but there is another trick used in kernel for this:

#define uninitialized_var(x) x = x

So, here is updated patch.