From: Luc Van Oostenryck <lucvoo@kernel.org>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
Randy Dunlap <rdunlap@infradead.org>,
kernel test robot <lkp@intel.com>
Subject: [PATCH] predefine __ATOMIC_ACQUIRE & friends as weak
Date: Tue, 14 Jun 2022 02:17:25 +0200 [thread overview]
Message-ID: <20220614001725.29431-1-lucvoo@kernel.org> (raw)
In-Reply-To: <33a053bc-1d81-49f4-0c8a-879a5519c433@infradead.org>
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
In kernel's arch/mips/Makefile the whole content of gcc's -dM is used
for CHECKFLAGS. This conflict with some macros also defined internally:
builtin:1:9: warning: preprocessor token __ATOMIC_ACQUIRE redefined
builtin:0:0: this was the original definition
Fix this by using a weak define for these macros.
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
predefine.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/predefine.c b/predefine.c
index 98e38a04579d..5b0f0caf4c35 100644
--- a/predefine.c
+++ b/predefine.c
@@ -179,12 +179,12 @@ void predefined_macros(void)
if (arch_target->has_int128)
predefined_sizeof("INT128", "", 128);
- predefine("__ATOMIC_RELAXED", 0, "0");
- predefine("__ATOMIC_CONSUME", 0, "1");
- predefine("__ATOMIC_ACQUIRE", 0, "3");
- predefine("__ATOMIC_RELEASE", 0, "4");
- predefine("__ATOMIC_ACQ_REL", 0, "7");
- predefine("__ATOMIC_SEQ_CST", 0, "8");
+ predefine("__ATOMIC_RELAXED", 1, "0");
+ predefine("__ATOMIC_CONSUME", 1, "1");
+ predefine("__ATOMIC_ACQUIRE", 1, "3");
+ predefine("__ATOMIC_RELEASE", 1, "4");
+ predefine("__ATOMIC_ACQ_REL", 1, "7");
+ predefine("__ATOMIC_SEQ_CST", 1, "8");
predefine("__ORDER_LITTLE_ENDIAN__", 1, "1234");
predefine("__ORDER_BIG_ENDIAN__", 1, "4321");
--
2.36.1
prev parent reply other threads:[~2022-06-14 0:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-06 18:53 sparse v0.6.4 Ramsay Jones
2021-09-07 6:14 ` Luc Van Oostenryck
2022-01-15 4:25 ` Randy Dunlap
2022-05-21 13:54 ` Luc Van Oostenryck
2022-05-21 15:51 ` Randy Dunlap
2022-06-14 0:17 ` Luc Van Oostenryck [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=20220614001725.29431-1-lucvoo@kernel.org \
--to=lucvoo@kernel.org \
--cc=linux-sparse@vger.kernel.org \
--cc=lkp@intel.com \
--cc=luc.vanoostenryck@gmail.com \
--cc=rdunlap@infradead.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).