* [PATCH] checkpatch: DT bindings should be a separate patch
@ 2018-08-09 20:50 Rob Herring
2018-08-10 0:53 ` Andrew Morton
2018-08-10 1:07 ` Joe Perches
0 siblings, 2 replies; 3+ messages in thread
From: Rob Herring @ 2018-08-09 20:50 UTC (permalink / raw)
To: Joe Perches; +Cc: linux-kernel, Andrew Morton, Andy Whitcroft
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 | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a9c05506e325..20547c109ccd 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,27 @@ sub process {
$check = $check_orig;
}
$checklicenseline = 1;
+
+ if ($realfile !~ /MAINTAINERS/) {
+ my $mixed = 0;
+ if ($realfile =~ /(Documentation\/devicetree|include\/dt-bindings).*/) {
+ if ($is_binding_patch == 0) {
+ $mixed = 1;
+ }
+ $is_binding_patch = 1;
+ } else {
+ if ($is_binding_patch == 1) {
+ $mixed = 1;
+ }
+ $is_binding_patch = 0;
+ }
+
+ if ($mixed == 1) {
+ WARN("DT_SPLIT_BINDING_PATCH",
+ "DT binding docs and includes should be a separate patch\n");
+ }
+ }
+
next;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] checkpatch: DT bindings should be a separate patch
2018-08-09 20:50 [PATCH] checkpatch: DT bindings should be a separate patch Rob Herring
@ 2018-08-10 0:53 ` Andrew Morton
2018-08-10 1:07 ` Joe Perches
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2018-08-10 0:53 UTC (permalink / raw)
To: Rob Herring; +Cc: Joe Perches, linux-kernel, Andy Whitcroft
On Thu, 9 Aug 2018 14:50:32 -0600 Rob Herring <robh@kernel.org> 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.
>
> ...
>
> --- 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,27 @@ sub process {
> $check = $check_orig;
> }
> $checklicenseline = 1;
> +
> + if ($realfile !~ /MAINTAINERS/) {
> + my $mixed = 0;
> + if ($realfile =~ /(Documentation\/devicetree|include\/dt-bindings).*/) {
> + if ($is_binding_patch == 0) {
> + $mixed = 1;
> + }
> + $is_binding_patch = 1;
> + } else {
> + if ($is_binding_patch == 1) {
> + $mixed = 1;
> + }
> + $is_binding_patch = 0;
> + }
> +
> + if ($mixed == 1) {
> + WARN("DT_SPLIT_BINDING_PATCH",
> + "DT binding docs and includes should be a separate patch\n");
A pointer to Documentation/devicetree/bindings/submitting-patches.txt
might be helpful?
> + }
> + }
> +
> next;
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] checkpatch: DT bindings should be a separate patch
2018-08-09 20:50 [PATCH] checkpatch: DT bindings should be a separate patch Rob Herring
2018-08-10 0:53 ` Andrew Morton
@ 2018-08-10 1:07 ` Joe Perches
1 sibling, 0 replies; 3+ messages in thread
From: Joe Perches @ 2018-08-10 1:07 UTC (permalink / raw)
To: Rob Herring; +Cc: linux-kernel, Andrew Morton, Andy Whitcroft
On Thu, 2018-08-09 at 14: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.
[]
> diff --git 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,27 @@ sub process {
> $check = $check_orig;
> }
> $checklicenseline = 1;
> +
> + if ($realfile !~ /MAINTAINERS/) {
Should probably be /^MAINTAINERS/
> + my $mixed = 0;
> + if ($realfile =~ /(Documentation\/devicetree|include\/dt-bindings).*/) {
This should have a ^ for the start of the filename and
generally, this is easier to read using m@...@ like:
if ($realfile =~ m@^(?:Documentation/devicetree/|include/dt-bindings/)@) {
> + if ($is_binding_patch == 0) {
> + $mixed = 1;
> + }
> + $is_binding_patch = 1;
> + } else {
> + if ($is_binding_patch == 1) {
> + $mixed = 1;
> + }
> + $is_binding_patch = 0;
> + }
Perhaps there is simpler logic using an xor.
> + if ($mixed == 1) {
> + WARN("DT_SPLIT_BINDING_PATCH",
> + "DT binding docs and includes should be a separate patch\n");
> + }
Perhaps add 'see: Documentation/devicetree/bindings/submitting-patches.txt'
> + }
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-08-10 1:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-09 20:50 [PATCH] checkpatch: DT bindings should be a separate patch Rob Herring
2018-08-10 0:53 ` Andrew Morton
2018-08-10 1:07 ` Joe Perches
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.