From: Bjorn Helgaas <helgaas@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>,
Jonathan Corbet <corbet@lwn.net>
Cc: Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
llvm@lists.linux.dev, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>
Subject: [PATCH 2/2] Documentation/sparse: Add hints about __CHECKER__
Date: Thu, 10 Mar 2022 16:09:27 -0600 [thread overview]
Message-ID: <20220310220927.245704-3-helgaas@kernel.org> (raw)
In-Reply-To: <20220310220927.245704-1-helgaas@kernel.org>
From: Bjorn Helgaas <bhelgaas@google.com>
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.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
Documentation/dev-tools/sparse.rst | 2 ++
include/linux/compiler_types.h | 1 +
include/uapi/linux/types.h | 1 +
3 files changed, 4 insertions(+)
diff --git a/Documentation/dev-tools/sparse.rst b/Documentation/dev-tools/sparse.rst
index 02102be7ff49..dc791c8d84d1 100644
--- a/Documentation/dev-tools/sparse.rst
+++ b/Documentation/dev-tools/sparse.rst
@@ -100,3 +100,5 @@ have already built it.
The optional make variable CF can be used to pass arguments to sparse. The
build system passes -Wbitwise to sparse automatically.
+
+Note that sparse defines the __CHECKER__ preprocessor symbol.
diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
index 3c1795fdb568..4b3915ce38a4 100644
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -4,6 +4,7 @@
#ifndef __ASSEMBLY__
+/* sparse defines __CHECKER__; see Documentation/dev-tools/sparse.rst */
#ifdef __CHECKER__
/* address spaces */
# define __kernel __attribute__((address_space(0)))
diff --git a/include/uapi/linux/types.h b/include/uapi/linux/types.h
index 71696f424ac8..c4dc597f3dcf 100644
--- a/include/uapi/linux/types.h
+++ b/include/uapi/linux/types.h
@@ -19,6 +19,7 @@
* any application/library that wants linux/types.h.
*/
+/* sparse defines __CHECKER__; see Documentation/dev-tools/sparse.rst */
#ifdef __CHECKER__
#define __bitwise __attribute__((bitwise))
#else
--
2.25.1
prev parent reply other threads:[~2022-03-10 22:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-10 22:09 [PATCH 0/2] linux/types.h: Tidy __bitwise, add __CHECKER__ hints Bjorn Helgaas
2022-03-10 22:09 ` [PATCH 1/2] linux/types.h: Remove unnecessary __bitwise__ Bjorn Helgaas
2022-03-11 1:52 ` Andrew Morton
2022-03-11 16:18 ` Bjorn Helgaas
2022-03-10 22:09 ` Bjorn Helgaas [this message]
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=20220310220927.245704-3-helgaas@kernel.org \
--to=helgaas@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bhelgaas@google.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mst@redhat.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox