mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
Documentation/sparse: add hints about __CHECKER__
Several attributes depend on __CHECKER__, but previously there was no clue in the tree about when __CHECKER__ might be defined. Add hints at the most common places (__kernel, __user, __iomem, __bitwise) and in the sparse documentation. Link: https://lkml.kernel.org/r/20220310220927.245704-3-helgaas@kernel.org Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Nathan Chancellor <nathan@kernel.org> Cc: Nick Desaulniers <ndesaulniers@google.com> Cc: "Michael S . Tsirkin" <mst@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
c724c866bb
commit
179fd6ba3b
@ -100,3 +100,5 @@ have already built it.
|
|||||||
|
|
||||||
The optional make variable CF can be used to pass arguments to sparse. The
|
The optional make variable CF can be used to pass arguments to sparse. The
|
||||||
build system passes -Wbitwise to sparse automatically.
|
build system passes -Wbitwise to sparse automatically.
|
||||||
|
|
||||||
|
Note that sparse defines the __CHECKER__ preprocessor symbol.
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
|
/* sparse defines __CHECKER__; see Documentation/dev-tools/sparse.rst */
|
||||||
#ifdef __CHECKER__
|
#ifdef __CHECKER__
|
||||||
/* address spaces */
|
/* address spaces */
|
||||||
# define __kernel __attribute__((address_space(0)))
|
# define __kernel __attribute__((address_space(0)))
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
* any application/library that wants linux/types.h.
|
* any application/library that wants linux/types.h.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* sparse defines __CHECKER__; see Documentation/dev-tools/sparse.rst */
|
||||||
#ifdef __CHECKER__
|
#ifdef __CHECKER__
|
||||||
#define __bitwise __attribute__((bitwise))
|
#define __bitwise __attribute__((bitwise))
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user