diff options
| author | Tom Rini <trini@konsulko.com> | 2020-08-03 22:20:22 -0400 |
|---|---|---|
| committer | Tom Rini <trini@konsulko.com> | 2020-08-03 22:20:22 -0400 |
| commit | d6faedca7670a0b4862cace2f3189998cbec87d8 (patch) | |
| tree | 387ca6154bbfb29b7ff30946cac70036146c5cb6 /scripts/checkpatch.pl | |
| parent | 68941e3b2c217907a49aa66af8bb65729b913397 (diff) | |
| parent | 23552ba142860205c4ddec414417cdc251f8cb79 (diff) | |
Merge branch '2020-08-01-misc-cleanups'
- Further cleanup of common.h and dm.h usage in headers
Diffstat (limited to 'scripts/checkpatch.pl')
| -rwxr-xr-x | scripts/checkpatch.pl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 238f12cb46..3932362dba 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2322,7 +2322,7 @@ sub get_raw_comment { # Checks specific to U-Boot sub u_boot_line { - my ($realfile, $line, $herecurr) = @_; + my ($realfile, $line, $rawline, $herecurr) = @_; # ask for a test if a new uclass ID is added if ($realfile =~ /uclass-id.h/ && $line =~ /^\+/) { @@ -2353,6 +2353,12 @@ sub u_boot_line { ERROR("DEFINE_CONFIG_CMD", "All commands are managed by Kconfig\n" . $herecurr); } + + # Don't put common.h and 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); + } } sub process { @@ -3296,7 +3302,7 @@ sub process { } if ($u_boot) { - u_boot_line($realfile, $line, $herecurr); + u_boot_line($realfile, $line, $rawline, $herecurr); } # check we are in a valid source file C or perl if not then ignore this hunk |
