diff options
author | Jack Rosenthal <jrosenth@chromium.org> | 2022-02-08 12:01:56 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-02-08 21:05:16 +0000 |
commit | 1a9f7b95fe5a3886989bd155ddb9bb689a911226 (patch) | |
tree | 524ec096e5d255cf7f17e93d0a0b7da1f840327b /.checkpatch.conf | |
parent | 2c3f1b8c00120f50201dc7ea0a9d84b89a0faaf9 (diff) | |
download | chrome-ec-1a9f7b95fe5a3886989bd155ddb9bb689a911226.tar.gz |
checkpatch: Optionally allow braces for single-statement if
This disables checkpatch complaining when braces are used with a
single-statement if.
The Zephyr coding style [1] requires braces of if, else, do, while,
for, and switch, even when not explicitly required (the body is only a
single statement).
In the interest of making code easier to upstream, we should encourage
conforming more closely to Zephyr's style for all EC code.
[1]: https://docs.zephyrproject.org/latest/contribute/#coding-style
BUG=b:218330171
BRANCH=none
TEST="checkpatch.pl --no-tree --ignore SPDX_LICENSE_TAG \
-f zephyr/shim/src/console_buffer.c" passes
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Change-Id: I827528ec54a62db05b8e04504cd040bb3aa66be0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3448989
Reviewed-by: Yuval Peress <peress@google.com>
Commit-Queue: Yuval Peress <peress@google.com>
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to '.checkpatch.conf')
-rw-r--r-- | .checkpatch.conf | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/.checkpatch.conf b/.checkpatch.conf index c8f945bc05..28ccc0dbb9 100644 --- a/.checkpatch.conf +++ b/.checkpatch.conf @@ -20,3 +20,9 @@ # Zephyr has a function named "printk" with different facilities than # the printk in the Linux kernel this check is made for. --ignore PRINTK_WITHOUT_KERN_LEVEL + +# Zephyr coding style requires braces even when not explicitly +# required (unlike the Linux kernel). In the interest of making code +# easier to upstream into the Zephyr tree, we should do the same. +# Tell checkpatch to ignore Linux style here. +--ignore BRACES |