mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
To: Masahiro Yamada <yamada.masahiro@socionext.com>,
	Will Deacon <will@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	Mark Rutland <mark.rutland@arm.com>
Cc: linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Rikard Falkeborn <rikard.falkeborn@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Kees Cook <keescook@chromium.org>,
	Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Subject: [RFC PATCH v2 1/2] check-atomiscs: stop build if CONFIG_WERROR=y
Date: Sat,  7 May 2022 22:11:44 +0900	[thread overview]
Message-ID: <20220507131146.834810-2-mailhol.vincent@wanadoo.fr> (raw)
In-Reply-To: <20220507131146.834810-1-mailhol.vincent@wanadoo.fr>

If CONFIG_WERROR=y, stop the build if one of the generated atomics
header in include/linux/atomic/* is modified by returning an error
instead of a warning.

If CONFIG_WERROR is not set, behavior is unchanged (let the build
continue).

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 scripts/atomic/check-atomics.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/atomic/check-atomics.sh b/scripts/atomic/check-atomics.sh
index 0e7bab3eb0d1..56f9e753bc74 100755
--- a/scripts/atomic/check-atomics.sh
+++ b/scripts/atomic/check-atomics.sh
@@ -26,8 +26,13 @@ while read header; do
 	NEWSUM="${NEWSUM%% *}"
 
 	if [ "${OLDSUM}" != "${NEWSUM}" ]; then
-		printf "warning: generated include/${header} has been modified.\n"
+		if grep -q CONFIG_WERROR=y .config; then
+			printf "error: generated include/${header} has been modified.\n"
+			exit 1
+		else
+			printf "warning: generated include/${header} has been modified.\n"
+		fi
 	fi
 done
 
-exit 0
+exit $?
-- 
2.35.1


  reply	other threads:[~2022-05-07 13:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-26 15:52 [RFC PATCH] kbuild: call checksyscalls.sh and check-atomics.sh only if prerequisites change Vincent Mailhol
2022-04-29 17:11 ` Masahiro Yamada
2022-05-07 11:43   ` Vincent MAILHOL
2022-05-07 13:11 ` [RFC PATCH v2 0/2] call " Vincent Mailhol
2022-05-07 13:11   ` Vincent Mailhol [this message]
2022-05-07 13:11   ` [RFC PATCH v2 2/2] kbuild: " Vincent Mailhol
2022-05-13 19:01     ` Masahiro Yamada
2022-05-14  3:21       ` Vincent MAILHOL
2022-05-14 13:14       ` Peter Zijlstra
2022-05-14 14:55         ` Peter Zijlstra
2022-05-14 16:26           ` Masahiro Yamada
2022-05-16  8:02             ` Peter Zijlstra
2022-05-14 16:07         ` Masahiro Yamada
2022-05-16  7:59           ` Peter Zijlstra

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=20220507131146.834810-2-mailhol.vincent@wanadoo.fr \
    --to=mailhol.vincent@wanadoo.fr \
    --cc=akpm@linux-foundation.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=arnd@arndb.de \
    --cc=boqun.feng@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=peterz@infradead.org \
    --cc=rikard.falkeborn@gmail.com \
    --cc=will@kernel.org \
    --cc=yamada.masahiro@socionext.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

all inboxes | Powered by JetHome®