1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-08-31 16:22:36 +02:00

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>
This commit is contained in:
Simon Glass
2020-07-19 10:16:01 -06:00
committed by Tom Rini
parent 4620d46bf0
commit 23552ba142
2 changed files with 15 additions and 2 deletions

View File

@@ -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()