<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/compiler.h, branch v3.10</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.10</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.10'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2013-04-08T15:28:34Z</updated>
<entry>
<title>kprobes: Move __kprobes definition into compiler.h</title>
<updated>2013-04-08T15:28:34Z</updated>
<author>
<name>Masami Hiramatsu</name>
<email>masami.hiramatsu.pt@hitachi.com</email>
</author>
<published>2013-04-04T10:40:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=324670b620ab1ed00ba160e435686bd2ae4a59ce'/>
<id>urn:sha1:324670b620ab1ed00ba160e435686bd2ae4a59ce</id>
<content type='text'>
Currently, __kprobes is defined in linux/kprobes.h which
is too big to be included in small or basic headers
that want to make use of this simple attribute.

So move __kprobes definition into linux/compiler.h
in which other compiler attributes are defined.

Signed-off-by: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Cc: Timo Juhani Lindfors &lt;timo.lindfors@iki.fi&gt;
Cc: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: Pavel Emelyanov &lt;xemul@parallels.com&gt;
Cc: Jiri Kosina &lt;jkosina@suse.cz&gt;
Cc: Nadia Yvette Chambers &lt;nyc@holomorphy.com&gt;
Cc: yrl.pp-manager.tt@hitachi.com
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/20130404104049.21071.20908.stgit@mhiramat-M0-7522
[ Improved the attribute explanation a bit. ]
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>bug.h, compiler.h: introduce compiletime_assert &amp; BUILD_BUG_ON_MSG</title>
<updated>2013-02-22T01:22:16Z</updated>
<author>
<name>Daniel Santos</name>
<email>daniel.santos@pobox.com</email>
</author>
<published>2013-02-22T00:41:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9a8ab1c39970a4938a72d94e6fd13be88a797590'/>
<id>urn:sha1:9a8ab1c39970a4938a72d94e6fd13be88a797590</id>
<content type='text'>
Introduce compiletime_assert to compiler.h, which moves the details of
how to break a build and emit an error message for a specific compiler
to the headers where these details should be.  Following in the
tradition of the POSIX assert macro, compiletime_assert creates a
build-time error when the supplied condition is *false*.

Next, we add BUILD_BUG_ON_MSG to bug.h which simply wraps
compiletime_assert, inverting the logic, so that it fails when the
condition is *true*, consistent with the language "build bug on." This
macro allows you to specify the error message you want emitted when the
supplied condition is true.

Finally, we remove all other code from bug.h that mucks with these
details (BUILD_BUG &amp; BUILD_BUG_ON), and have them all call
BUILD_BUG_ON_MSG.  This not only reduces source code bloat, but also
prevents the possibility of code being changed for one macro and not for
the other (which was previously the case for BUILD_BUG and
BUILD_BUG_ON).

Since __compiletime_error_fallback is now only used in compiler.h, I'm
considering it a private macro and removing the double negation that's
now extraneous.

[akpm@linux-foundation.org: checkpatch fixes]
Signed-off-by: Daniel Santos &lt;daniel.santos@pobox.com&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Joe Perches &lt;joe@perches.com&gt;
Cc: Josh Triplett &lt;josh@joshtriplett.org&gt;
Cc: Paul Gortmaker &lt;paul.gortmaker@windriver.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>compiler.h, bug.h: prevent double error messages with BUILD_BUG{,_ON}</title>
<updated>2013-02-22T01:22:16Z</updated>
<author>
<name>Daniel Santos</name>
<email>daniel.santos@pobox.com</email>
</author>
<published>2013-02-22T00:41:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c361d3e54364d19bb5e803d6e766e94674da7b0e'/>
<id>urn:sha1:c361d3e54364d19bb5e803d6e766e94674da7b0e</id>
<content type='text'>
Prior to the introduction of __attribute__((error("msg"))) in gcc 4.3,
creating compile-time errors required a little trickery.
BUILD_BUG{,_ON} uses this attribute when available to generate
compile-time errors, but also uses the negative-sized array trick for
older compilers, resulting in two error messages in some cases.  The
reason it's "some" cases is that as of gcc 4.4, the negative-sized array
will not create an error in some situations, like inline functions.

This patch replaces the negative-sized array code with the new
__compiletime_error_fallback() macro which expands to the same thing
unless the the error attribute is available, in which case it expands to
do{}while(0), resulting in exactly one compile-time error on all
versions of gcc.

Note that we are not changing the negative-sized array code for the
unoptimized version of BUILD_BUG_ON, since it has the potential to catch
problems that would be disabled in later versions of gcc were
__compiletime_error_fallback used.  The reason is that that an
unoptimized build can't always remove calls to an error-attributed
function call (like we are using) that should effectively become dead
code if it were optimized.  However, using a negative-sized array with a
similar value will not result in an false-positive (error).  The only
caveat being that it will also fail to catch valid conditions, which we
should be expecting in an unoptimized build anyway.

Signed-off-by: Daniel Santos &lt;daniel.santos@pobox.com&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Joe Perches &lt;joe@perches.com&gt;
Cc: Josh Triplett &lt;josh@joshtriplett.org&gt;
Cc: Paul Gortmaker &lt;paul.gortmaker@windriver.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>compiler{,-gcc4}.h, bug.h: Remove duplicate macros</title>
<updated>2013-02-22T01:22:15Z</updated>
<author>
<name>Daniel Santos</name>
<email>daniel.santos@pobox.com</email>
</author>
<published>2013-02-22T00:41:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6ae8d04871f84d853673e9e9f3f713e77a2fe145'/>
<id>urn:sha1:6ae8d04871f84d853673e9e9f3f713e77a2fe145</id>
<content type='text'>
__linktime_error() does the same thing as __compiletime_error() and is
only used in bug.h.  Since the macro defines a function attribute that
will cause a failure at compile-time (not link-time), it makes more sense
to keep __compiletime_error(), which is also neatly mated with
__compiletime_warning().

Signed-off-by: Daniel Santos &lt;daniel.santos@pobox.com&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Acked-by: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Joe Perches &lt;joe@perches.com&gt;
Cc: Josh Triplett &lt;josh@joshtriplett.org&gt;
Cc: Paul Gortmaker &lt;paul.gortmaker@windriver.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>Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux</title>
<updated>2012-12-19T15:55:08Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-12-19T15:55:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7a684c452e2589f3ddd7e2d466b4f747d3715ad9'/>
<id>urn:sha1:7a684c452e2589f3ddd7e2d466b4f747d3715ad9</id>
<content type='text'>
Pull module update from Rusty Russell:
 "Nothing all that exciting; a new module-from-fd syscall for those who
  want to verify the source of the module (ChromeOS) and/or use standard
  IMA on it or other security hooks."

* tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  MODSIGN: Fix kbuild output when using default extra_certificates
  MODSIGN: Avoid using .incbin in C source
  modules: don't hand 0 to vmalloc.
  module: Remove a extra null character at the top of module-&gt;strtab.
  ASN.1: Use the ASN1_LONG_TAG and ASN1_INDEFINITE_LENGTH constants
  ASN.1: Define indefinite length marker constant
  moduleparam: use __UNIQUE_ID()
  __UNIQUE_ID()
  MODSIGN: Add modules_sign make target
  powerpc: add finit_module syscall.
  ima: support new kernel module syscall
  add finit_module syscall to asm-generic
  ARM: add finit_module syscall to ARM
  security: introduce kernel_module_from_file hook
  module: add flags arg to sys_finit_module()
  module: add syscall to load module from fd
</content>
</entry>
<entry>
<title>linux/compiler.h: add __must_hold macro for functions called with a lock held</title>
<updated>2012-12-18T01:15:23Z</updated>
<author>
<name>Josh Triplett</name>
<email>josh@joshtriplett.org</email>
</author>
<published>2012-12-18T00:03:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8529091e8e2ae25e0f4003086f619765ff255e4b'/>
<id>urn:sha1:8529091e8e2ae25e0f4003086f619765ff255e4b</id>
<content type='text'>
linux/compiler.h has macros to denote functions that acquire or release
locks, but not to denote functions called with a lock held that return
with the lock still held.  Add a __must_hold macro to cover that case.

Signed-off-by: Josh Triplett &lt;josh@joshtriplett.org&gt;
Reported-by: Ed Cashin &lt;ecashin@coraid.com&gt;
Tested-by: Ed Cashin &lt;ecashin@coraid.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>__UNIQUE_ID()</title>
<updated>2012-12-14T02:35:30Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2012-11-22T02:00:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6f33d58794ef4cef4b2c706029810f9688bd3026'/>
<id>urn:sha1:6f33d58794ef4cef4b2c706029810f9688bd3026</id>
<content type='text'>
Jan Beulich points out __COUNTER__ (gcc 4.3 and above), so let's use
that to create unique ids.  This is better than __LINE__ which we use
today, so provide a wrapper.

Stanislaw Gruszka &lt;sgruszka@redhat.com&gt; reported that some module parameters
start with a digit, so we need to prepend when we for the unique id.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Acked-by: Jan Beulich &lt;jbeulich@suse.com&gt;
</content>
</entry>
<entry>
<title>compiler.h: add __visible</title>
<updated>2012-09-17T22:00:38Z</updated>
<author>
<name>Andi Kleen</name>
<email>ak@linux.intel.com</email>
</author>
<published>2012-09-17T21:09:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9a858dc7cebce01a7bb616bebb85087fa2b40871'/>
<id>urn:sha1:9a858dc7cebce01a7bb616bebb85087fa2b40871</id>
<content type='text'>
gcc 4.6+ has support for a externally_visible attribute that prevents the
optimizer from optimizing unused symbols away.  Add a __visible macro to
use it with that compiler version or later.

This is used (at least) by the "Link Time Optimization" patchset.

Signed-off-by: Andi Kleen &lt;ak@linux.intel.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>compiler.h: Fix typo</title>
<updated>2012-02-28T15:02:54Z</updated>
<author>
<name>Alexander Stein</name>
<email>alexander.stein@systec-electronic.com</email>
</author>
<published>2012-02-23T12:42:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e6be0c9e7e9f68b99e5a5ba609c455bae4b141d5'/>
<id>urn:sha1:e6be0c9e7e9f68b99e5a5ba609c455bae4b141d5</id>
<content type='text'>
Signed-off-by: Alexander Stein &lt;alexander.stein@systec-electronic.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>kernel.h: add BUILD_BUG() macro</title>
<updated>2012-01-11T00:30:42Z</updated>
<author>
<name>David Daney</name>
<email>david.daney@cavium.com</email>
</author>
<published>2012-01-10T23:07:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1399ff86f2a2bbacbbe68fa00c5f8c752b344723'/>
<id>urn:sha1:1399ff86f2a2bbacbbe68fa00c5f8c752b344723</id>
<content type='text'>
We can place this in definitions that we expect the compiler to remove by
dead code elimination.  If this assertion fails, we get a nice error
message at build time.

The GCC function attribute error("message") was added in version 4.3, so
we define a new macro __linktime_error(message) to expand to this for
GCC-4.3 and later.  This will give us an error diagnostic from the
compiler on the line that fails.  For other compilers
__linktime_error(message) expands to nothing, and we have to be content
with a link time error, but at least we will still get a build error.

BUILD_BUG() expands to the undefined function __build_bug_failed() and
will fail at link time if the compiler ever emits code for it.  On GCC-4.3
and later, attribute((error())) is used so that the failure will be noted
at compile time instead.

Signed-off-by: David Daney &lt;david.daney@cavium.com&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Cc: DM &lt;dm.n9107@gmail.com&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Acked-by: David Howells &lt;dhowells@redhat.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>
