<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/asm-generic/bug.h, branch v3.0</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.0</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.0'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2011-05-26T19:00:31Z</updated>
<entry>
<title>bug.h: Move ratelimit warn interfaces to ratelimit.h</title>
<updated>2011-05-26T19:00:31Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2011-05-26T19:00:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=86e4ca66e81bba0f8640f1fa19b8b8f72cbd0561'/>
<id>urn:sha1:86e4ca66e81bba0f8640f1fa19b8b8f72cbd0561</id>
<content type='text'>
As reported by Ingo Molnar, we still have configuration combinations
where use of the WARN_RATELIMIT interfaces break the build because
dependencies don't get met.

Instead of going down the long road of trying to make it so that
ratelimit.h can get included by kernel.h or asm-generic/bug.h,
just move the interface into ratelimit.h and make users have
to include that.

Reported-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Acked-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
</content>
</entry>
<entry>
<title>bug.h: Fix build with CONFIG_PRINTK disabled.</title>
<updated>2011-05-24T20:15:56Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2011-05-24T20:15:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6b3678354647a653e669746c05765f05d2b90239'/>
<id>urn:sha1:6b3678354647a653e669746c05765f05d2b90239</id>
<content type='text'>
Based upon an email by Joe Perches.

Reported-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Acked-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
</content>
</entry>
<entry>
<title>bug.h: Add WARN_RATELIMIT</title>
<updated>2011-05-23T21:37:43Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2011-05-21T07:48:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b3eec79b0776e5340a3db75b34953977c7e5086e'/>
<id>urn:sha1:b3eec79b0776e5340a3db75b34953977c7e5086e</id>
<content type='text'>
Add a generic mechanism to ratelimit WARN(foo, fmt, ...) messages
using a hidden per call site static struct ratelimit_state.

Also add an __WARN_RATELIMIT variant to be able to use a specific
struct ratelimit_state.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>WARN_ON_SMP(): Add comment to explain ({0;})</title>
<updated>2011-03-28T14:10:42Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-03-25T20:21:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ccd0d44fad38dc1bb4b26dcc7a30e9f2c3b36870'/>
<id>urn:sha1:ccd0d44fad38dc1bb4b26dcc7a30e9f2c3b36870</id>
<content type='text'>
The define to use ({0;}) for the !CONFIG_SMP case of WARN_ON_SMP()
can be confusing. As the WARN_ON_SMP() needs to be a nop when
CONFIG_SMP is not set, including all its parameters must not be
evaluated, and that it must work as both a stand alone statement
and inside an if condition, we define it to a funky ({0;}).

A simple "0" will not work as it causes gcc to give the warning that
the statement has no effect.

As this strange definition has raised a few eyebrows from some
major kernel developers, it is wise to document why we create such
a work of art.

Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>WARN_ON_SMP(): Allow use in if() statements on UP</title>
<updated>2011-03-25T10:32:09Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-03-17T19:21:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2092e6be82ec71ecbf5a8ceeef004bbcbdb78812'/>
<id>urn:sha1:2092e6be82ec71ecbf5a8ceeef004bbcbdb78812</id>
<content type='text'>
Both WARN_ON() and WARN_ON_SMP() should be able to be used in
an if statement.

	if (WARN_ON_SMP(foo)) { ... }

Because WARN_ON_SMP() is defined as a do { } while (0) on UP,
it can not be used this way.

Convert it to the same form that WARN_ON() is, even when
CONFIG_SMP is off.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Acked-by: Darren Hart &lt;dvhart@linux.intel.com&gt;
Cc: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
LKML-Reference: &lt;20110317192208.444147791@goodmis.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>panic: Allow warnings to set different taint flags</title>
<updated>2010-05-19T07:36:48Z</updated>
<author>
<name>Ben Hutchings</name>
<email>ben@decadent.org.uk</email>
</author>
<published>2010-04-03T18:34:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b2be05273a1744d175bf4b67f6665637bb9ac7a8'/>
<id>urn:sha1:b2be05273a1744d175bf4b67f6665637bb9ac7a8</id>
<content type='text'>
WARN() is used in some places to report firmware or hardware bugs that
are then worked-around.  These bugs do not affect the stability of the
kernel and should not set the flag for TAINT_WARN.  To allow for this,
add WARN_TAINT() and WARN_TAINT_ONCE() macros that take a taint number
as argument.

Architectures that implement warnings using trap instructions instead
of calls to warn_slowpath_*() now implement __WARN_TAINT(taint)
instead of __WARN().

Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Acked-by: Helge Deller &lt;deller@gmx.de&gt;
Tested-by: Paul Mundt &lt;lethal@linux-sh.org&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</content>
</entry>
<entry>
<title>WARN_ONCE(): use bool for boolean flag</title>
<updated>2009-12-15T16:53:25Z</updated>
<author>
<name>Cesar Eduardo Barros</name>
<email>cesarb@cesarb.net</email>
</author>
<published>2009-12-15T02:00:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=42f247c83aeb52d2ee7a9fe23fb57e22317f18fd'/>
<id>urn:sha1:42f247c83aeb52d2ee7a9fe23fb57e22317f18fd</id>
<content type='text'>
Commit 70867453092297be9afb2249e712a1f960ec0a09 ("printk_once(): use bool
for boolean flag") changed printk_once() to use bool instead of int for
its guard variable.  Do the same change to WARN_ONCE() and WARN_ON_ONCE(),
for the same reasons.

This resulted in a reduction of 1462 bytes on a x86-64 defconfig:

   text    data     bss     dec     hex filename
8101271 1207116  992764 10301151         9d2edf vmlinux.before
8100553 1207148  991988 10299689         9d2929 vmlinux.after

Signed-off-by: Cesar Eduardo Barros &lt;cesarb@cesarb.net&gt;
Cc: Roland Dreier &lt;rolandd@cisco.com&gt;
Cc: Daniel Walker &lt;dwalker@fifo99.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Eliminate thousands of warnings with gcc 3.2 build</title>
<updated>2009-05-06T23:36:09Z</updated>
<author>
<name>Andi Kleen</name>
<email>andi@firstfloor.org</email>
</author>
<published>2009-05-06T23:02:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=57adc4d2dbf968fdbe516359688094eef4d46581'/>
<id>urn:sha1:57adc4d2dbf968fdbe516359688094eef4d46581</id>
<content type='text'>
When building with gcc 3.2 I get thousands of warnings such as

include/linux/gfp.h: In function `allocflags_to_migratetype':
include/linux/gfp.h:105: warning: null format string

due to passing a NULL format string to warn_slowpath() in

#define __WARN()		warn_slowpath(__FILE__, __LINE__, NULL)

Split this case out into a separate call.  This also shrinks the kernel
slightly:

          text    data     bss     dec     hex filename
       4802274  707668  712704 6222646  5ef336 vmlinux
          text    data     bss     dec     hex filename
       4799027  703572  712704 6215303  5ed687 vmlinux

due to removeing one argument from the commonly-called __WARN().

[akpm@linux-foundation.org: reduce scope of `empty']
Acked-by: Jesper Nilsson &lt;jesper.nilsson@axis.com&gt;
Acked-by: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Acked-by: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Hugh Dickins &lt;hugh@veritas.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>The default CONFIG_BUG=n version of BUG() should have an empty do...while</title>
<updated>2009-04-15T20:55:13Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2009-04-15T18:34:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=da60682c116855cf342926b4f3427079400ee7e6'/>
<id>urn:sha1:da60682c116855cf342926b4f3427079400ee7e6</id>
<content type='text'>
The default CONFIG_BUG=n version of BUG() should incorporate an empty a
do...while statement to avoid compilation weirdness.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>documentation: when to BUG(), and when to not BUG()</title>
<updated>2009-01-06T23:59:13Z</updated>
<author>
<name>David Brownell</name>
<email>dbrownell@users.sourceforge.net</email>
</author>
<published>2009-01-06T22:41:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=af9379c7121d5543722c00bbd1adf7dcaa0b6448'/>
<id>urn:sha1:af9379c7121d5543722c00bbd1adf7dcaa0b6448</id>
<content type='text'>
Provide some basic advice about when to use BUG()/BUG_ON(): never, unless
there's really no better option.

This matches my understanding of the standard policy ...  which seems not
to be written down so far, outside of LKML messages that I haven't
bookmarked.

Signed-off-by: David Brownell &lt;dbrownell@users.sourceforge.net&gt;
Cc: Hans Verkuil &lt;hverkuil@xs4all.nl&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Arjan van de Ven &lt;arjan@infradead.org&gt;
Cc: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
