From: Thomas Monjalon Date: Mon, 21 Nov 2016 22:42:41 +0000 (+0100) Subject: scripts: fix checkpatch from standard input X-Git-Tag: spdx-start~5309 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b5415fbc69dd33a1bb64a140b2f6bc73d11e4d22;p=dpdk.git scripts: fix checkpatch from standard input When checking a valid patch from standard input, the footer lines of the report are not filtered out. The function check is called outside of any loop, so the statement continue can have no effect and the footer is printed. More precisons about possible behaviours - with dash, the 'continue' acts like a return in that case - with bash, it displays an error: "continue: only meaningful in a `for', `while', or `until' loop" - with bash --posix, the 'continue' is ignored Fixes: 8005feef421d ("scripts: add standard input to checkpatch") Signed-off-by: Thomas Monjalon Acked-by: Olivier Matz --- diff --git a/scripts/checkpatches.sh b/scripts/checkpatches.sh index 336cc7b41d..cfe262bec4 100755 --- a/scripts/checkpatches.sh +++ b/scripts/checkpatches.sh @@ -94,7 +94,7 @@ check () { # else report=$($DPDK_CHECKPATCH_PATH $options - 2>/dev/null) fi - [ $? -ne 0 ] || continue + [ $? -ne 0 ] || return 0 $verbose || printf '\n### %s\n\n' "$3" printf '%s\n' "$report" | sed -n '1,/^total:.*lines checked$/p' status=$(($status + 1))