Skip to content

Commit

Permalink
checkpatch: DT bindings should be a separate patch
Browse files Browse the repository at this point in the history
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.

[[email protected]: add doc pointer to warning, simplify logic]
  Link: http://lkml.kernel.org/r/[email protected]
[[email protected]: v3]
  Link: http://lkml.kernel.org/r/[email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Rob Herring <[email protected]>
Acked-by: Joe Perches <[email protected]>
Cc: Andy Whitcroft <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
robherring authored and torvalds committed Aug 22, 2018
1 parent 809e082 commit 133712a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2251,6 +2251,7 @@ sub process {
my $author = '';
my $authorsignoff = 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
Expand Down Expand Up @@ -2501,6 +2502,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;
}

Expand Down

0 comments on commit 133712a

Please sign in to comment.