public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 1/7] checkpatch.pl: Make common.h check boarder
@ 2023-10-12 23:03 Tom Rini
  2023-10-12 23:03 ` [PATCH 2/7] include: Add <linux/types.h> in a few places Tom Rini
                   ` (6 more replies)
  0 siblings, 7 replies; 26+ messages in thread
From: Tom Rini @ 2023-10-12 23:03 UTC (permalink / raw)
  To: u-boot; +Cc: Simon Glass

At this point in time we should not add common.h to any new files, so
make checkpatch.pl complain.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
Cc: Simon Glass <sjg@chromium.org>

This causes a bunch of patman tests, for checkpatch, to now fail and I
don't really understand why, at all.  And that was before I added a test
for the new error, which I had hoped would clear up the problem.
---
 scripts/checkpatch.pl           | 8 +++++++-
 tools/patman/test_checkpatch.py | 7 ++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 488d73a0ed77..c3314da8a3c7 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2636,12 +2636,18 @@ sub u_boot_line {
 		      "All CONFIG symbols are managed by Kconfig\n" . $herecurr);
 	}
 
-	# Don't put common.h and dm.h in header files
+	# Don't put dm.h in header files
 	if ($realfile =~ /\.h$/ && $rawline =~ /^\+#include\s*<(common|dm)\.h>*/) {
 		ERROR("BARRED_INCLUDE_IN_HDR",
 		      "Avoid including common.h and dm.h in header files\n" . $herecurr);
 	}
 
+	# Don't add common.h to files
+	if ($rawline =~ /^\+#include\s*<(common|dm)\.h>*/) {
+		ERROR("BARRED_INCLUDE_COMMON_H",
+		      "Do not add common.h to files\n" . $herecurr);
+	}
+
 	# Do not disable fdt / initrd relocation
 	if ($rawline =~ /^\+.*(fdt|initrd)_high=0xffffffff/) {
 		ERROR("DISABLE_FDT_OR_INITRD_RELOC",
diff --git a/tools/patman/test_checkpatch.py b/tools/patman/test_checkpatch.py
index a8bb364e42b2..187736d617d5 100644
--- a/tools/patman/test_checkpatch.py
+++ b/tools/patman/test_checkpatch.py
@@ -401,10 +401,15 @@ index 0000000..2234c87
     def test_barred_include_in_hdr(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.check_single_message(pm, 'BARRED_INCLUDE_IN_HDR', 'error')
 
+    def test_barred_include_common_h(self):
+        """Test for adding common.h to a file"""
+        pm = PatchMaker()
+        pm.add_line('include/myfile.h', '#include <common.h>')
+        self.check_single_message(pm, 'BARRED_INCLUDE_COMMON_H', 'error')
+
     def test_config_is_enabled_config(self):
         """Test for accidental CONFIG_IS_ENABLED(CONFIG_*) calls"""
         pm = PatchMaker()
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2023-10-24 23:19 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-12 23:03 [PATCH 1/7] checkpatch.pl: Make common.h check boarder Tom Rini
2023-10-12 23:03 ` [PATCH 2/7] include: Add <linux/types.h> in a few places Tom Rini
2023-10-13 15:14   ` Simon Glass
2023-10-24 23:15   ` Tom Rini
2023-10-12 23:03 ` [PATCH 3/7] arc: Remove common.h usage Tom Rini
2023-10-13  9:21   ` Alexey Brodkin
2023-10-24 23:15   ` Tom Rini
2023-10-12 23:03 ` [PATCH 4/7] m68k: " Tom Rini
2023-10-13 15:14   ` Simon Glass
2023-10-13 15:17     ` Tom Rini
2023-10-13 16:57       ` Simon Glass
2023-10-13 20:53   ` Angelo Dureghello
2023-10-13 20:55     ` Tom Rini
2023-10-13 21:40       ` Angelo Dureghello
2023-10-24 23:16   ` Tom Rini
2023-10-12 23:03 ` [PATCH 5/7] microblaze: " Tom Rini
2023-10-13  7:11   ` Michal Simek
2023-10-24 23:16   ` Tom Rini
2023-10-12 23:03 ` [PATCH 6/7] mips: " Tom Rini
2023-10-24 23:16   ` Tom Rini
2023-10-12 23:03 ` [PATCH 7/7] riscv: " Tom Rini
     [not found]   ` <SEZPR03MB8064C345D63766D2E86B2184C1D2A@SEZPR03MB8064.apcprd03.prod.outlook.com>
2023-10-13  8:52     ` Rick Chen
2023-10-24 23:16   ` Tom Rini
2023-10-13 15:15 ` [PATCH 1/7] checkpatch.pl: Make common.h check boarder Simon Glass
2023-10-13 15:16   ` Tom Rini
2023-10-13 15:49     ` Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox