summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-07-19 10:16:01 -0600
committerTom Rini <trini@konsulko.com>2020-08-03 22:19:54 -0400
commit23552ba142860205c4ddec414417cdc251f8cb79 (patch)
tree387ca6154bbfb29b7ff30946cac70036146c5cb6 /tools
parent4620d46bf0aa00df3857a5883b790da3d12995dd (diff)
checkpatch: Don't allow common.h and dm.h in headers
These headers should not be included in other header files. Add a checkpatch rule and test for this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/patman/test_checkpatch.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/patman/test_checkpatch.py b/tools/patman/test_checkpatch.py
index 9d233f99ae..792196e689 100644
--- a/tools/patman/test_checkpatch.py
+++ b/tools/patman/test_checkpatch.py
@@ -398,6 +398,13 @@ index 0000000..2234c87
pm.add_line('common/main.c', '#undef CONFIG_CMD_WHICH')
self.checkSingleMessage(pm, 'DEFINE_CONFIG_CMD', 'error')
+ def testBarredIncludeInHdr(self):
+ """Test for using a barred include in a header file"""
+ pm = PatchMaker()
+ #pm.add_line('include/myfile.h', '#include <common.h>')
+ pm.add_line('include/myfile.h', '#include <dm.h>')
+ self.checkSingleMessage(pm, 'BARRED_INCLUDE_IN_HDR', 'error')
+
if __name__ == "__main__":
unittest.main()