Merge pull request #1861 from Yann-lms/checkpatch
authorDimitris Papastamos <dimitris.papastamos@arm.com>
Wed, 13 Mar 2019 13:58:10 +0000 (13:58 +0000)
committerGitHub <noreply@github.com>
Wed, 13 Mar 2019 13:58:10 +0000 (13:58 +0000)
Update checkpatch options

.checkpatch.conf
Makefile

index 50ab7169c51beb89f0bd0543bbe847507f8e3588..2a5396148d29ab8ae73408952406b66cfce0b4d5 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
+# Copyright (c) 2016-2019, ARM Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
 # "Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt"
 # We allow the usage of the volatile keyword in TF.
 --ignore VOLATILE
+
+# BRACES reports this kind of messages:
+# braces {} are not necessary for any arm of this statement
+--ignore BRACES
+
+# PREFER_KERNEL_TYPES reports this kind of messages (when using --strict):
+# "Prefer kernel type 'u32' over 'uint32_t'"
+--ignore PREFER_KERNEL_TYPES
+
+# USLEEP_RANGE reports this kind of messages (when using --strict):
+# "usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt"
+--ignore USLEEP_RANGE
+
+# COMPARISON_TO_NULL reports this kind of messages (when using --strict):
+# Comparison to NULL could be written ""
+--ignore COMPARISON_TO_NULL
+
+# UNNECESSARY_PARENTHESES reports this kind of messages (when using --strict):
+# Unnecessary parentheses around ""
+--ignore UNNECESSARY_PARENTHESES
index 6386befd1aba3c252df493c1356501e2459ebd0f..c6d42106d83f6db578db7c5fdd53ef87713b2f40 100644 (file)
--- 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}