From fc577f4fbf4840abd121fccc2c1b968402bca641 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Sat, 29 Mar 2025 11:48:49 +0800 Subject: [PATCH] scripts: checkpatch: Match fw version only once Signed-off-by: Joseph Chen Change-Id: I125615f9f02c3c1f15a65369b1506526e62a2577 --- scripts/checkpatch.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.sh b/scripts/checkpatch.sh index d0eef683..ae108003 100755 --- a/scripts/checkpatch.sh +++ b/scripts/checkpatch.sh @@ -430,9 +430,9 @@ function check_version() echo "ERROR: ${FILE}: No \"fwver: \" string found in binary" exit 1 fi - FW_VER=`strings ${FILE} | grep -o 'fwver: v[1-9][.][0-9][0-9]' | awk '{ print $2 }'` + FW_VER=`strings ${FILE} | grep -m 1 -o 'fwver: v[1-9][.][0-9][0-9]' | awk '{ print $2 }'` if [ "${NAME_VER}" != "${FW_VER}" ] ; then - echo "ERROR: ${FILE}: file version is ${NAME_VER}, but fw version is ${FW_VER}." + echo "ERROR: ${FILE}: file version is '${NAME_VER}', but fw version is '${FW_VER}'." exit 1 fi done