From 02a76d5ff25a287489ae652b5ebfe0e96b504a67 Mon Sep 17 00:00:00 2001 From: Yann Gautier Date: Fri, 8 Mar 2019 15:44:00 +0100 Subject: [PATCH] Add the possibility to pass options for checkpatch It can be handy for example to add --strict option which can detect more coding issues, even if not mandated by TF-A coding rules. To use it: CHECKPATCH_OPTS="--strict" make checkpatch Change-Id: I707e4cc2d1250b21f18ff16169b5f1e5ab03a7ed Signed-off-by: Yann Gautier --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6386befd1..c6d42106d 100644 --- a/Makefile +++ b/Makefile @@ -841,13 +841,18 @@ checkcodebase: locate-checkpatch checkpatch: locate-checkpatch @echo " CHECKING STYLE" + @if test -n "${CHECKPATCH_OPTS}"; then \ + echo " with ${CHECKPATCH_OPTS} option(s)"; \ + fi ${Q}COMMON_COMMIT=$$(git merge-base HEAD ${BASE_COMMIT}); \ for commit in `git rev-list $$COMMON_COMMIT..HEAD`; do \ printf "\n[*] Checking style of '$$commit'\n\n"; \ git log --format=email "$$commit~..$$commit" \ - -- ${CHECK_PATHS} | ${CHECKPATCH} - || true; \ + -- ${CHECK_PATHS} | \ + ${CHECKPATCH} ${CHECKPATCH_OPTS} - || true; \ git diff --format=email "$$commit~..$$commit" \ - -- ${CHECK_PATHS} | ${CHECKPATCH} - || true; \ + -- ${CHECK_PATHS} | \ + ${CHECKPATCH} ${CHECKPATCH_OPTS} - || true; \ done certtool: ${CRTTOOL}