All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	Daniel Santos <daniel.santos@pobox.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: Re: [PATCH] compiler.h: don't use temporary variable in __compiletime_assert()
Date: Thu, 8 May 2014 08:56:46 +0200	[thread overview]
Message-ID: <20140508065646.GF2844@laptop.programming.kicks-ass.net> (raw)
In-Reply-To: <1399530685-7749-1-git-send-email-johannes@sipsolutions.net>

On Thu, May 08, 2014 at 08:31:25AM +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.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@intel.com>

Acked-by: Peter Zijlstra <peterz@infradead.org>

  parent reply	other threads:[~2014-05-08  6:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08  6:31 [PATCH] compiler.h: don't use temporary variable in __compiletime_assert() Johannes Berg
2014-05-08  6:54 ` Luca Coelho
2014-05-08  6:56 ` Peter Zijlstra [this message]
2014-05-08 13:18 ` Paul E. McKenney
2014-05-12 13:42 ` James Hogan
2014-05-12 13:42   ` James Hogan
2014-05-12 14:38   ` Johannes Berg
2014-05-12 14:56     ` James Hogan
2014-05-12 14:56       ` James Hogan
2014-05-12 21:16   ` Andrew Morton
2014-05-12 21:16     ` Andrew Morton
2014-05-13  7:31     ` Johannes Berg
2014-05-13  8:53       ` James Hogan
2014-05-13  8:53         ` James Hogan
2014-05-13  9:26         ` Johannes Berg

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=20140508065646.GF2844@laptop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=daniel.santos@pobox.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.