add checkpatch check

This commit is contained in:
Yu Liao 2023-10-30 11:29:14 +08:00 committed by yanhaitao
parent f4d0867b0f
commit c3e6155a70

View File

@ -32,7 +32,7 @@
Name: kernel
Version: 4.19.90
Release: %{hulkrelease}.0225
Release: %{hulkrelease}.0226
Summary: Linux Kernel
License: GPLv2
URL: http://www.kernel.org/
@ -236,6 +236,28 @@ if [ ! -d patches ];then
mv ../patches .
fi
ignores_for_main="CONFIG_DESCRIPTION,FILE_PATH_CHANGES,GERRIT_CHANGE_ID,GIT_COMMIT_ID,UNKNOWN_COMMIT_ID,FROM_SIGN_OFF_MISMATCH,REPEATED_WORD,COMMIT_COMMENT_SYMBOL,BLOCK_COMMENT_STYLE,AVOID_EXTERNS,AVOID_BUG"
Checkpatches() {
local SERIESCONF=$1
local PATCH_DIR=$2
sed -i '/^#/d' $SERIESCONF
sed -i '/^[\s]*$/d' $SERIESCONF
set +e
while IFS= read -r patch; do
output=$(scripts/checkpatch.pl --ignore $ignores_for_main $PATCH_DIR/$patch)
if echo "$output" | grep -q "ERROR:"; then
echo "checkpatch $patch failed"
set -e
return 1
fi
done < "$SERIESCONF"
set -e
return 0
}
Applypatches()
{
set -e
@ -252,6 +274,7 @@ Applypatches()
) | sh
}
Checkpatches series.conf %{_builddir}/kernel-%{version}/linux-%{KernelVer}
Applypatches series.conf %{_builddir}/kernel-%{version}/linux-%{KernelVer}
%endif
@ -807,6 +830,9 @@ fi
%endif
%changelog
* Mon Oct 30 2023 Yu Liao <liaoyu15@huawei.com> - 4.19.90-2310.4.0.0226
- Add checkpatch check
* Sat Oct 28 2023 YunYi Yang <yangyunyi2@huawei.com> - 4.19.90-2310.4.0.0225
- config: arm64: Enable config of hisi ptt
- hwtracing: hisi_ptt: Add dummy callback pmu::read()