Skip to content

Commit 5b29567

Browse files
committed
sof-kernel-log-check.sh: simplify journalctl logic
No functional change. - Get rid of the "if $ignore_str" condition because it's not going to be empty anytime soon. It will be a very good problem to have when it is! Then it will be easy to turn it into an array like in the next commit. - Don't check whether the $err string is empty but use the `grep` exit status directly. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
1 parent ed3b230 commit 5b29567

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

tools/sof-kernel-log-check.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -427,18 +427,15 @@ else
427427
fi
428428

429429
declare -p cmd
430-
# check priority err for error message
431-
if [[ "$ignore_str" ]]; then
432-
err=$($cmd --priority=err | grep -vE "$ignore_str")
433-
else
434-
err=$($cmd --priority=err)
435-
fi
436430

437-
[[ -z "$err" ]] || {
431+
if err=$($cmd --priority=err |
432+
grep -v -E -e "$ignore_str"); then
433+
438434
type journalctl_cmd
439435
echo "$(date -u '+%Y-%m-%d %T %Z')" "[ERROR]" "Caught kernel log error"
440436
echo "===========================>>"
441437
echo "$err"
442438
echo "<<==========================="
443439
builtin exit 1
444-
}
440+
441+
fi

0 commit comments

Comments
 (0)