.checkpatch.conf 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #
  2. # Copyright (c) 2016-2019, ARM Limited and Contributors. All rights reserved.
  3. #
  4. # SPDX-License-Identifier: BSD-3-Clause
  5. #
  6. #
  7. # Configure how the Linux checkpatch script should be invoked in the context of
  8. # the Trusted Firmware source tree.
  9. #
  10. # This is not Linux so don't expect a Linux tree!
  11. --no-tree
  12. # The Linux kernel expects the SPDX license tag in the first line of each file.
  13. # We don't follow this in the Trusted Firmware.
  14. --ignore SPDX_LICENSE_TAG
  15. # This clarifes the lines indications in the report.
  16. #
  17. # E.g.:
  18. # Without this option, we have the following output:
  19. # #333: FILE: drivers/arm/gic/arm_gic.c:160:
  20. # So we have 2 lines indications (333 and 160), which is confusing.
  21. # We only care about the position in the source file.
  22. #
  23. # With this option, it becomes:
  24. # drivers/arm/gic/arm_gic.c:160:
  25. --showfile
  26. # Don't show some messages like the list of ignored types or the suggestion to
  27. # use "--fix" or report changes to the maintainers.
  28. --quiet
  29. #
  30. # Ignore the following message types, as they don't necessarily make sense in
  31. # the context of the Trusted Firmware.
  32. #
  33. # COMPLEX_MACRO generates false positives.
  34. --ignore COMPLEX_MACRO
  35. # Commit messages might contain a Gerrit Change-Id.
  36. --ignore GERRIT_CHANGE_ID
  37. # Do not check the format of commit messages, as Gerrit's merge commits do not
  38. # preserve it.
  39. --ignore GIT_COMMIT_ID
  40. # FILE_PATH_CHANGES reports this kind of message:
  41. # "added, moved or deleted file(s), does MAINTAINERS need updating?"
  42. # We do not use this MAINTAINERS file process in TF.
  43. --ignore FILE_PATH_CHANGES
  44. # AVOID_EXTERNS reports this kind of messages:
  45. # "externs should be avoided in .c files"
  46. # We don't follow this convention in TF.
  47. --ignore AVOID_EXTERNS
  48. # NEW_TYPEDEFS reports this kind of messages:
  49. # "do not add new typedefs"
  50. # We allow adding new typedefs in TF.
  51. --ignore NEW_TYPEDEFS
  52. # Avoid "Does not appear to be a unified-diff format patch" message
  53. --ignore NOT_UNIFIED_DIFF
  54. # VOLATILE reports this kind of messages:
  55. # "Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt"
  56. # We allow the usage of the volatile keyword in TF.
  57. --ignore VOLATILE
  58. # BRACES reports this kind of messages:
  59. # braces {} are not necessary for any arm of this statement
  60. --ignore BRACES
  61. # PREFER_KERNEL_TYPES reports this kind of messages (when using --strict):
  62. # "Prefer kernel type 'u32' over 'uint32_t'"
  63. --ignore PREFER_KERNEL_TYPES
  64. # USLEEP_RANGE reports this kind of messages (when using --strict):
  65. # "usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt"
  66. --ignore USLEEP_RANGE
  67. # COMPARISON_TO_NULL reports this kind of messages (when using --strict):
  68. # Comparison to NULL could be written ""
  69. --ignore COMPARISON_TO_NULL
  70. # UNNECESSARY_PARENTHESES reports this kind of messages (when using --strict):
  71. # Unnecessary parentheses around ""
  72. --ignore UNNECESSARY_PARENTHESES