diff mbox series

[v3] checkpatch: DT bindings should be a separate patch

Message ID 20180810225049.20452-1-robh@kernel.org
State Accepted
Commit 133712a2ec8493596565e9de3d25659d6e66a47e
Headers show
Series [v3] checkpatch: DT bindings should be a separate patch | expand

Commit Message

Rob Herring Aug. 10, 2018, 10:50 p.m. UTC
Devicetree bindings should be their own patch as documented in
Documentation/devicetree/bindings/submitting-patches.txt section I.1.
This is because bindings are logically independent from a driver
implementation, they have a different maintainer (even though they often
are applied via the same tree), and it makes for a cleaner history in
the DT only tree created with git-filter-branch.

Cc: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Rob Herring <robh@kernel.org>

---
 scripts/checkpatch.pl | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

-- 
2.17.1

Comments

Joe Perches Aug. 10, 2018, 11:17 p.m. UTC | #1
On Fri, 2018-08-10 at 16:50 -0600, Rob Herring wrote:
> Devicetree bindings should be their own patch as documented in

> Documentation/devicetree/bindings/submitting-patches.txt section I.1.

> This is because bindings are logically independent from a driver

> implementation, they have a different maintainer (even though they often

> are applied via the same tree), and it makes for a cleaner history in

> the DT only tree created with git-filter-branch.


Thanks Rob.
Acked-by: Joe Perches <joe@perches.com>
diff mbox series

Patch

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a9c05506e325..fa9b50d6f3d4 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2236,6 +2236,7 @@  sub process {
 	our $clean = 1;
 	my $signoff = 0;
 	my $is_patch = 0;
+	my $is_binding_patch = -1;
 	my $in_header_lines = $file ? 0 : 1;
 	my $in_commit_log = 0;		#Scanning lines before patch
 	my $has_commit_log = 0;		#Encountered lines before patch
@@ -2485,6 +2486,19 @@  sub process {
 				$check = $check_orig;
 			}
 			$checklicenseline = 1;
+
+			if ($realfile !~ /^MAINTAINERS/) {
+				my $last_binding_patch = $is_binding_patch;
+
+				$is_binding_patch = () = $realfile =~ m@^(?:Documentation/devicetree/|include/dt-bindings/)@;
+
+				if (($last_binding_patch != -1) &&
+				    ($last_binding_patch ^ $is_binding_patch)) {
+					WARN("DT_SPLIT_BINDING_PATCH",
+					     "DT binding docs and includes should be a separate patch. See: Documentation/devicetree/bindings/submitting-patches.txt\n");
+				}
+			}
+
 			next;
 		}