[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1399532071.12300.0.camel@dubbel>
Date: Thu, 08 May 2014 09:54:31 +0300
From: Luca Coelho <luca@...lho.fi>
To: Johannes Berg <johannes@...solutions.net>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Daniel Santos <daniel.santos@...ox.com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Subject: Re: [PATCH] compiler.h: don't use temporary variable in
__compiletime_assert()
On Thu, 2014-05-08 at 08:31 +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@...el.com>
>
> Usually, BUG_ON and friends aren't even evaluated in sparse, but
> recently compiletime_assert_atomic_type() was added, and that now
> results in a sparse warning every time it is used.
>
> The reason turns out to be the temporary variable, after it sparse
> no longer considers the value to be a constant, and results in a
> warning and an error. The error is the more annoying part of this
> as it suppresses any further warnings in the same file, hiding
> other problems.
>
> Since this is all about compile time and the condition should be
> side-effect free to start with, there's no downside (apart maybe
> from a slight compilation time penalty?) to just duplicating it,
> leaving sparse able to evaluate it at check time, getting rid of
> the warning and error.
>
> Signed-off-by: Johannes Berg <johannes.berg@...el.com>
> ---
Tested-by: Luciano Coelho <luciano.coelho@...el.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists