xref: /rk3399_ARM-atf/.checkpatch.conf (revision d4abda29fbc66739955573e439d59248cf356788)
1f607739cSSandrine Bailleux#
2*d4abda29SYann Gautier# Copyright (c) 2016-2019, ARM Limited and Contributors. All rights reserved.
3f607739cSSandrine Bailleux#
4205bd569SAntonio Nino Diaz# SPDX-License-Identifier: BSD-3-Clause
5f607739cSSandrine Bailleux#
6f607739cSSandrine Bailleux
7f607739cSSandrine Bailleux#
8f607739cSSandrine Bailleux# Configure how the Linux checkpatch script should be invoked in the context of
9f607739cSSandrine Bailleux# the Trusted Firmware source tree.
10f607739cSSandrine Bailleux#
11f607739cSSandrine Bailleux
12f607739cSSandrine Bailleux# This is not Linux so don't expect a Linux tree!
13f607739cSSandrine Bailleux--no-tree
14f607739cSSandrine Bailleux
1590582e4dSAntonio Nino Diaz# The Linux kernel expects the SPDX license tag in the first line of each file.
1690582e4dSAntonio Nino Diaz# We don't follow this in the Trusted Firmware.
1790582e4dSAntonio Nino Diaz--ignore SPDX_LICENSE_TAG
1890582e4dSAntonio Nino Diaz
19f607739cSSandrine Bailleux# This clarifes the lines indications in the report.
20f607739cSSandrine Bailleux#
21f607739cSSandrine Bailleux# E.g.:
22f607739cSSandrine Bailleux# Without this option, we have the following output:
23f607739cSSandrine Bailleux#      #333: FILE: drivers/arm/gic/arm_gic.c:160:
24f607739cSSandrine Bailleux# So we have 2 lines indications (333 and 160), which is confusing.
25f607739cSSandrine Bailleux# We only care about the position in the source file.
26f607739cSSandrine Bailleux#
27f607739cSSandrine Bailleux# With this option, it becomes:
28f607739cSSandrine Bailleux#      drivers/arm/gic/arm_gic.c:160:
29f607739cSSandrine Bailleux--showfile
30f607739cSSandrine Bailleux
3151d28937SAntonio Nino Diaz# Don't show some messages like the list of ignored types or the suggestion to
3251d28937SAntonio Nino Diaz# use "--fix" or report changes to the maintainers.
3351d28937SAntonio Nino Diaz--quiet
3451d28937SAntonio Nino Diaz
35f607739cSSandrine Bailleux#
36f607739cSSandrine Bailleux# Ignore the following message types, as they don't necessarily make sense in
37f607739cSSandrine Bailleux# the context of the Trusted Firmware.
38f607739cSSandrine Bailleux#
39f607739cSSandrine Bailleux
40f607739cSSandrine Bailleux# COMPLEX_MACRO generates false positives.
41f607739cSSandrine Bailleux--ignore COMPLEX_MACRO
42f607739cSSandrine Bailleux
43f607739cSSandrine Bailleux# Commit messages might contain a Gerrit Change-Id.
44f607739cSSandrine Bailleux--ignore GERRIT_CHANGE_ID
45f607739cSSandrine Bailleux
46f607739cSSandrine Bailleux# Do not check the format of commit messages, as Github's merge commits do not
47f607739cSSandrine Bailleux# observe it.
48f607739cSSandrine Bailleux--ignore GIT_COMMIT_ID
49f607739cSSandrine Bailleux
50f607739cSSandrine Bailleux# FILE_PATH_CHANGES reports this kind of message:
51f607739cSSandrine Bailleux# "added, moved or deleted file(s), does MAINTAINERS need updating?"
52f607739cSSandrine Bailleux# We do not use this MAINTAINERS file process in TF.
53f607739cSSandrine Bailleux--ignore FILE_PATH_CHANGES
54f607739cSSandrine Bailleux
55f607739cSSandrine Bailleux# AVOID_EXTERNS reports this kind of messages:
56f607739cSSandrine Bailleux# "externs should be avoided in .c files"
57f607739cSSandrine Bailleux# We don't follow this convention in TF.
58f607739cSSandrine Bailleux--ignore AVOID_EXTERNS
59f607739cSSandrine Bailleux
60f607739cSSandrine Bailleux# NEW_TYPEDEFS reports this kind of messages:
61f607739cSSandrine Bailleux# "do not add new typedefs"
62f607739cSSandrine Bailleux# We allow adding new typedefs in TF.
63f607739cSSandrine Bailleux--ignore NEW_TYPEDEFS
64f607739cSSandrine Bailleux
6551d28937SAntonio Nino Diaz# Avoid "Does not appear to be a unified-diff format patch" message
6651d28937SAntonio Nino Diaz--ignore NOT_UNIFIED_DIFF
6751d28937SAntonio Nino Diaz
68f607739cSSandrine Bailleux# VOLATILE reports this kind of messages:
69f607739cSSandrine Bailleux# "Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt"
70f607739cSSandrine Bailleux# We allow the usage of the volatile keyword in TF.
71f607739cSSandrine Bailleux--ignore VOLATILE
72*d4abda29SYann Gautier
73*d4abda29SYann Gautier# BRACES reports this kind of messages:
74*d4abda29SYann Gautier# braces {} are not necessary for any arm of this statement
75*d4abda29SYann Gautier--ignore BRACES
76