Skip to content

Commit ebf8d82

Browse files
michaelforneyingomolnar
authored andcommitted
locking/atomics: Use sed(1) instead of non-standard head(1) option
POSIX says the -n option must be a positive decimal integer. Not all implementations of head(1) support negative numbers meaning offset from the end of the file. Instead, the sed expression '$d' has the same effect of removing the last line of the file. Signed-off-by: Michael Forney <mforney@mforney.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Will Deacon <will.deacon@arm.com> Cc: Boqun Feng <boqun.feng@gmail.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20190618053306.730-1-mforney@mforney.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 886532a commit ebf8d82

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎scripts/atomic/check-atomics.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ while read header; do
2222
OLDSUM="$(tail -n 1 ${LINUXDIR}/include/${header})"
2323
OLDSUM="${OLDSUM#// }"
2424

25-
NEWSUM="$(head -n -1 ${LINUXDIR}/include/${header} | sha1sum)"
25+
NEWSUM="$(sed '$d' ${LINUXDIR}/include/${header} | sha1sum)"
2626
NEWSUM="${NEWSUM%% *}"
2727

2828
if [ "${OLDSUM}" != "${NEWSUM}" ]; then

0 commit comments

Comments
 (0)