diff options
| author | Mark Rutland <[email protected]> | 2018-09-04 11:48:29 +0100 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2018-11-01 11:01:10 +0100 |
| commit | 8d32588077bdc390420cfa6946f407033a20d7a8 (patch) | |
| tree | 8826038ca127335c11514bb308179ad2d6e83d69 /scripts/atomic | |
| parent | aa525d063851a98e020b827fdd1d7776ae652301 (diff) | |
locking/atomics: Check generated headers are up-to-date
Now that all the generated atomic headers are in place, it would be good
to ensure that:
a) the headers are up-to-date when scripting changes.
b) developers don't directly modify the generated headers.
To ensure both of these properties, let's add a Kbuild step to check
that the generated headers are up-to-date.
Signed-off-by: Mark Rutland <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Will Deacon <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Boqun Feng <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'scripts/atomic')
| -rw-r--r-- | scripts/atomic/check-atomics.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/atomic/check-atomics.sh b/scripts/atomic/check-atomics.sh new file mode 100644 index 000000000000..c30101cddf2d --- /dev/null +++ b/scripts/atomic/check-atomics.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# +# Check if atomic headers are up-to-date + +ATOMICDIR=$(dirname $0) +ATOMICTBL=${ATOMICDIR}/atomics.tbl +LINUXDIR=${ATOMICDIR}/../.. + +cat <<EOF | +gen-atomic-instrumented.sh asm-generic/atomic-instrumented.h +gen-atomic-long.sh asm-generic/atomic-long.h +gen-atomic-fallback.sh linux/atomic-fallback.h +EOF +while read script header; do + if ! (${ATOMICDIR}/${script} ${ATOMICTBL} | diff - ${LINUXDIR}/include/${header} > /dev/null); then + printf "warning: include/${header} is out-of-date.\n" + fi +done |