xref: /rk3399_ARM-atf/.checkpatch.conf (revision 3ce3ce07385a6fe55018d825318a9aba2dab7289)
1f607739cSSandrine Bailleux#
2d4abda29SYann 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
46*cf57ff8bSJohn Tsichritzis# Do not check the format of commit messages, as Gerrit's merge commits do not
47*cf57ff8bSJohn Tsichritzis# preserve it.
48*cf57ff8bSJohn Tsichritzis--ignore GIT_COMMIT_ID
49*cf57ff8bSJohn Tsichritzis
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
72d4abda29SYann Gautier
73d4abda29SYann Gautier# BRACES reports this kind of messages:
74d4abda29SYann Gautier# braces {} are not necessary for any arm of this statement
75d4abda29SYann Gautier--ignore BRACES
7689d1d372SYann Gautier
7789d1d372SYann Gautier# PREFER_KERNEL_TYPES reports this kind of messages (when using --strict):
7889d1d372SYann Gautier# "Prefer kernel type 'u32' over 'uint32_t'"
7989d1d372SYann Gautier--ignore PREFER_KERNEL_TYPES
8089d1d372SYann Gautier
8189d1d372SYann Gautier# USLEEP_RANGE reports this kind of messages (when using --strict):
8289d1d372SYann Gautier# "usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt"
8389d1d372SYann Gautier--ignore USLEEP_RANGE
8489d1d372SYann Gautier
8589d1d372SYann Gautier# COMPARISON_TO_NULL reports this kind of messages (when using --strict):
8689d1d372SYann Gautier# Comparison to NULL could be written ""
8789d1d372SYann Gautier--ignore COMPARISON_TO_NULL
8889d1d372SYann Gautier
8989d1d372SYann Gautier# UNNECESSARY_PARENTHESES reports this kind of messages (when using --strict):
9089d1d372SYann Gautier# Unnecessary parentheses around ""
9189d1d372SYann Gautier--ignore UNNECESSARY_PARENTHESES
92