[PATCH openEuler-20.03-LTS-SP4] add checkpatch check

--- kernel.spec | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/kernel.spec b/kernel.spec index 5bcf9476f107..3c9e31996699 100644 --- a/kernel.spec +++ b/kernel.spec @@ -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 +* Fri 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() -- 2.33.0

反馈: 您发送到kernel-build@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/src-openeuler/kernel/pulls/1251 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel-build@openeuler.org/mes... FeedBack: The patch(es) which you have sent to kernel-build@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/src-openeuler/kernel/pulls/1251 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel-build@openeuler.org/mes...
participants (2)
-
patchwork bot
-
Yu Liao