linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] checkpatch: Warn if DT bindings are not in schema format
@ 2019-09-13 21:13 Rob Herring
  2019-09-13 21:48 ` Joe Perches
  0 siblings, 1 reply; 9+ messages in thread
From: Rob Herring @ 2019-09-13 21:13 UTC (permalink / raw)
  To: Joe Perches; +Cc: devicetree, linux-kernel, Andy Whitcroft

DT bindings are moving to using a json-schema based schema format
instead of freeform text. Add a checkpatch.pl check to encourage using
the schema for new bindings. It's not yet a requirement, but is
progressively being required by some maintainers.

Cc: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 scripts/checkpatch.pl | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 93a7edfe0f05..1cbd85f16e32 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2822,6 +2822,14 @@ sub process {
 			     "added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr);
 		}
 
+# Check for adding new DT bindings not in schema format
+		if (!$in_commit_log &&
+		    ($line =~ /^new file mode\s*\d+\s*$/) &&
+		    ($realfile =~ m@^Documentation/devicetree/bindings/.*\.txt$@)) {
+			WARN("DT_SCHEMA_BINDING_PATCH",
+			     "DT bindings should be in DT schema format. See: Documentation/devicetree/writing-schema.rst\n");
+		}
+
 # Check for wrappage within a valid hunk of the file
 		if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) {
 			ERROR("CORRUPTED_PATCH",
-- 
2.20.1


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

* Re: [PATCH] checkpatch: Warn if DT bindings are not in schema format
  2019-09-13 21:13 [PATCH] checkpatch: Warn if DT bindings are not in schema format Rob Herring
@ 2019-09-13 21:48 ` Joe Perches
  2019-09-16 18:21   ` Rob Herring
  2019-09-27 14:02   ` Rob Herring
  0 siblings, 2 replies; 9+ messages in thread
From: Joe Perches @ 2019-09-13 21:48 UTC (permalink / raw)
  To: Rob Herring; +Cc: devicetree, linux-kernel, Andy Whitcroft

On Fri, 2019-09-13 at 16:13 -0500, Rob Herring wrote:
> DT bindings are moving to using a json-schema based schema format
> instead of freeform text. Add a checkpatch.pl check to encourage using
> the schema for new bindings. It's not yet a requirement, but is
> progressively being required by some maintainers.
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -2822,6 +2822,14 @@ sub process {
>  			     "added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr);
>  		}
>  
> +# Check for adding new DT bindings not in schema format
> +		if (!$in_commit_log &&
> +		    ($line =~ /^new file mode\s*\d+\s*$/) &&
> +		    ($realfile =~ m@^Documentation/devicetree/bindings/.*\.txt$@)) {
> +			WARN("DT_SCHEMA_BINDING_PATCH",
> +			     "DT bindings should be in DT schema format. See: Documentation/devicetree/writing-schema.rst\n");
> +		}
> +

As this already seems to be git dependent, perhaps
it's easier to read with a single line test like:

		if ($line =~ m{^\s*create mode\s*\d+\s*Documentation/devicetree/bindings/.*\.txt$}) {
			etc...
		}

There are ~3500 existing .txt files:

$ git ls-files -- 'Documentation/devicetree/bindings/*.txt' | wc -l
3476

Are these going to be converted somehow?

What about files like these? (not .txt)

Documentation/devicetree/bindings/timer/st,stih407-lpc
Documentation/devicetree/bindings/nds32/andestech-boards
Documentation/devicetree/bindings/media/nokia,n900-ir
Documentation/devicetree/bindings/interrupt-controller/ti,omap4-wugen-mpu
Documentation/devicetree/bindings/arm/cpu-enable-method/nuvoton,npcm750-smp
Documentation/devicetree/bindings/arm/cpu-enable-method/marvell,berlin-smp
Documentation/devicetree/bindings/arm/cpu-enable-method/al,alpine-smp
Documentation/devicetree/bindings/arm/arm-boards




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

* Re: [PATCH] checkpatch: Warn if DT bindings are not in schema format
  2019-09-13 21:48 ` Joe Perches
@ 2019-09-16 18:21   ` Rob Herring
  2019-09-27 14:02   ` Rob Herring
  1 sibling, 0 replies; 9+ messages in thread
From: Rob Herring @ 2019-09-16 18:21 UTC (permalink / raw)
  To: Joe Perches; +Cc: devicetree, linux-kernel, Andy Whitcroft

On Fri, Sep 13, 2019 at 4:48 PM Joe Perches <joe@perches.com> wrote:
>
> On Fri, 2019-09-13 at 16:13 -0500, Rob Herring wrote:
> > DT bindings are moving to using a json-schema based schema format
> > instead of freeform text. Add a checkpatch.pl check to encourage using
> > the schema for new bindings. It's not yet a requirement, but is
> > progressively being required by some maintainers.
> []
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> []
> > @@ -2822,6 +2822,14 @@ sub process {
> >                            "added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr);
> >               }
> >
> > +# Check for adding new DT bindings not in schema format
> > +             if (!$in_commit_log &&
> > +                 ($line =~ /^new file mode\s*\d+\s*$/) &&
> > +                 ($realfile =~ m@^Documentation/devicetree/bindings/.*\.txt$@)) {
> > +                     WARN("DT_SCHEMA_BINDING_PATCH",
> > +                          "DT bindings should be in DT schema format. See: Documentation/devicetree/writing-schema.rst\n");
> > +             }
> > +
>
> As this already seems to be git dependent, perhaps
> it's easier to read with a single line test like:
>
>                 if ($line =~ m{^\s*create mode\s*\d+\s*Documentation/devicetree/bindings/.*\.txt$}) {
>                         etc...
>                 }

Okay. I wasn't too concerned about non-git diffs as I rarely see those anymore.

>
> There are ~3500 existing .txt files:
>
> $ git ls-files -- 'Documentation/devicetree/bindings/*.txt' | wc -l
> 3476
>
> Are these going to be converted somehow?

Patches welcome! We're working on it.

>
> What about files like these? (not .txt)
>
> Documentation/devicetree/bindings/timer/st,stih407-lpc
> Documentation/devicetree/bindings/nds32/andestech-boards
> Documentation/devicetree/bindings/media/nokia,n900-ir
> Documentation/devicetree/bindings/interrupt-controller/ti,omap4-wugen-mpu
> Documentation/devicetree/bindings/arm/cpu-enable-method/nuvoton,npcm750-smp
> Documentation/devicetree/bindings/arm/cpu-enable-method/marvell,berlin-smp
> Documentation/devicetree/bindings/arm/cpu-enable-method/al,alpine-smp
> Documentation/devicetree/bindings/arm/arm-boards

What about them? This check is only for new files and no one runs
checkpatch.pl on binding txt files. If someone submits something
without an extension, then I'll catch that in review. I'm not too
worried about 8 out of 3500 cases.

Rob

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

* Re: [PATCH] checkpatch: Warn if DT bindings are not in schema format
  2019-09-13 21:48 ` Joe Perches
  2019-09-16 18:21   ` Rob Herring
@ 2019-09-27 14:02   ` Rob Herring
  2019-09-27 14:29     ` Joe Perches
  1 sibling, 1 reply; 9+ messages in thread
From: Rob Herring @ 2019-09-27 14:02 UTC (permalink / raw)
  To: Joe Perches; +Cc: devicetree, linux-kernel, Andy Whitcroft

On Fri, Sep 13, 2019 at 4:48 PM Joe Perches <joe@perches.com> wrote:
>
> On Fri, 2019-09-13 at 16:13 -0500, Rob Herring wrote:
> > DT bindings are moving to using a json-schema based schema format
> > instead of freeform text. Add a checkpatch.pl check to encourage using
> > the schema for new bindings. It's not yet a requirement, but is
> > progressively being required by some maintainers.
> []
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> []
> > @@ -2822,6 +2822,14 @@ sub process {
> >                            "added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr);
> >               }
> >
> > +# Check for adding new DT bindings not in schema format
> > +             if (!$in_commit_log &&
> > +                 ($line =~ /^new file mode\s*\d+\s*$/) &&
> > +                 ($realfile =~ m@^Documentation/devicetree/bindings/.*\.txt$@)) {
> > +                     WARN("DT_SCHEMA_BINDING_PATCH",
> > +                          "DT bindings should be in DT schema format. See: Documentation/devicetree/writing-schema.rst\n");
> > +             }
> > +
>
> As this already seems to be git dependent, perhaps

It's quite rare to see a non git generated diff these days.

> it's easier to read with a single line test like:
>
>                 if ($line =~ m{^\s*create mode\s*\d+\s*Documentation/devicetree/bindings/.*\.txt$}) {
>                         etc...
>                 }

I frequently do 'git show $commit | scripts/checkpatch.pl' and this
doesn't work with that. I really should have a '--pretty=email' in
there, but I just ignore the commit msg warnings. In any case, that
still doesn't help because there's no diffstat. There's probably some
way to turn that on or just use git-format-patch, but really we want
this to work with any git diff.

Rob

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

* Re: [PATCH] checkpatch: Warn if DT bindings are not in schema format
  2019-09-27 14:02   ` Rob Herring
@ 2019-09-27 14:29     ` Joe Perches
  2019-09-27 15:39       ` Rob Herring
  0 siblings, 1 reply; 9+ messages in thread
From: Joe Perches @ 2019-09-27 14:29 UTC (permalink / raw)
  To: Rob Herring; +Cc: devicetree, linux-kernel, Andy Whitcroft

On Fri, 2019-09-27 at 09:02 -0500, Rob Herring wrote:
> On Fri, Sep 13, 2019 at 4:48 PM Joe Perches <joe@perches.com> wrote:
> > On Fri, 2019-09-13 at 16:13 -0500, Rob Herring wrote:
> > > DT bindings are moving to using a json-schema based schema format
> > > instead of freeform text. Add a checkpatch.pl check to encourage using
> > > the schema for new bindings. It's not yet a requirement, but is
> > > progressively being required by some maintainers.
> > []
> > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > []
> > > @@ -2822,6 +2822,14 @@ sub process {
> > >                            "added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr);
> > >               }
> > > 
> > > +# Check for adding new DT bindings not in schema format
> > > +             if (!$in_commit_log &&
> > > +                 ($line =~ /^new file mode\s*\d+\s*$/) &&
> > > +                 ($realfile =~ m@^Documentation/devicetree/bindings/.*\.txt$@)) {
> > > +                     WARN("DT_SCHEMA_BINDING_PATCH",
> > > +                          "DT bindings should be in DT schema format. See: Documentation/devicetree/writing-schema.rst\n");
> > > +             }
> > > +
> > 
> > As this already seems to be git dependent, perhaps
> 
> It's quite rare to see a non git generated diff these days.
> 
> > it's easier to read with a single line test like:
> > 
> >                 if ($line =~ m{^\s*create mode\s*\d+\s*Documentation/devicetree/bindings/.*\.txt$}) {
> >                         etc...
> >                 }
> 
> I frequently do 'git show $commit | scripts/checkpatch.pl' and this
> doesn't work with that. I really should have a '--pretty=email' in
> there, but I just ignore the commit msg warnings. In any case, that
> still doesn't help because there's no diffstat. There's probably some
> way to turn that on or just use git-format-patch, but really we want
> this to work with any git diff.

I don't understand your argument against what I proposed at all.

and btw:

$ git format-patch -1 --stdout <commit> | ./scripts/checkpatch.pl



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

* Re: [PATCH] checkpatch: Warn if DT bindings are not in schema format
  2019-09-27 14:29     ` Joe Perches
@ 2019-09-27 15:39       ` Rob Herring
  2019-10-11 17:56         ` Rob Herring
  0 siblings, 1 reply; 9+ messages in thread
From: Rob Herring @ 2019-09-27 15:39 UTC (permalink / raw)
  To: Joe Perches; +Cc: devicetree, linux-kernel, Andy Whitcroft

On Fri, Sep 27, 2019 at 9:29 AM Joe Perches <joe@perches.com> wrote:
>
> On Fri, 2019-09-27 at 09:02 -0500, Rob Herring wrote:
> > On Fri, Sep 13, 2019 at 4:48 PM Joe Perches <joe@perches.com> wrote:
> > > On Fri, 2019-09-13 at 16:13 -0500, Rob Herring wrote:
> > > > DT bindings are moving to using a json-schema based schema format
> > > > instead of freeform text. Add a checkpatch.pl check to encourage using
> > > > the schema for new bindings. It's not yet a requirement, but is
> > > > progressively being required by some maintainers.
> > > []
> > > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > > []
> > > > @@ -2822,6 +2822,14 @@ sub process {
> > > >                            "added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr);
> > > >               }
> > > >
> > > > +# Check for adding new DT bindings not in schema format
> > > > +             if (!$in_commit_log &&
> > > > +                 ($line =~ /^new file mode\s*\d+\s*$/) &&
> > > > +                 ($realfile =~ m@^Documentation/devicetree/bindings/.*\.txt$@)) {
> > > > +                     WARN("DT_SCHEMA_BINDING_PATCH",
> > > > +                          "DT bindings should be in DT schema format. See: Documentation/devicetree/writing-schema.rst\n");
> > > > +             }
> > > > +
> > >
> > > As this already seems to be git dependent, perhaps
> >
> > It's quite rare to see a non git generated diff these days.
> >
> > > it's easier to read with a single line test like:
> > >
> > >                 if ($line =~ m{^\s*create mode\s*\d+\s*Documentation/devicetree/bindings/.*\.txt$}) {
> > >                         etc...
> > >                 }
> >
> > I frequently do 'git show $commit | scripts/checkpatch.pl' and this
> > doesn't work with that. I really should have a '--pretty=email' in
> > there, but I just ignore the commit msg warnings. In any case, that
> > still doesn't help because there's no diffstat. There's probably some
> > way to turn that on or just use git-format-patch, but really we want
> > this to work with any git diff.
>
> I don't understand your argument against what I proposed at all.

It is dependent on the commit message rather than the diff itself. I
want it to work with or without a diffstat.

> and btw:
>
> $ git format-patch -1 --stdout <commit> | ./scripts/checkpatch.pl

Yes, I stated this was possible. My concern is there are lots of ways
to generate a diff in git. My way works for *all* of them. Yours
doesn't.

Rob

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

* Re: [PATCH] checkpatch: Warn if DT bindings are not in schema format
  2019-09-27 15:39       ` Rob Herring
@ 2019-10-11 17:56         ` Rob Herring
  2019-10-11 18:02           ` Joe Perches
  0 siblings, 1 reply; 9+ messages in thread
From: Rob Herring @ 2019-10-11 17:56 UTC (permalink / raw)
  To: Joe Perches; +Cc: devicetree, linux-kernel, Andy Whitcroft

On Fri, Sep 27, 2019 at 10:39 AM Rob Herring <robh@kernel.org> wrote:
>
> On Fri, Sep 27, 2019 at 9:29 AM Joe Perches <joe@perches.com> wrote:
> >
> > On Fri, 2019-09-27 at 09:02 -0500, Rob Herring wrote:
> > > On Fri, Sep 13, 2019 at 4:48 PM Joe Perches <joe@perches.com> wrote:
> > > > On Fri, 2019-09-13 at 16:13 -0500, Rob Herring wrote:
> > > > > DT bindings are moving to using a json-schema based schema format
> > > > > instead of freeform text. Add a checkpatch.pl check to encourage using
> > > > > the schema for new bindings. It's not yet a requirement, but is
> > > > > progressively being required by some maintainers.
> > > > []
> > > > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > > > []
> > > > > @@ -2822,6 +2822,14 @@ sub process {
> > > > >                            "added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr);
> > > > >               }
> > > > >
> > > > > +# Check for adding new DT bindings not in schema format
> > > > > +             if (!$in_commit_log &&
> > > > > +                 ($line =~ /^new file mode\s*\d+\s*$/) &&
> > > > > +                 ($realfile =~ m@^Documentation/devicetree/bindings/.*\.txt$@)) {
> > > > > +                     WARN("DT_SCHEMA_BINDING_PATCH",
> > > > > +                          "DT bindings should be in DT schema format. See: Documentation/devicetree/writing-schema.rst\n");
> > > > > +             }
> > > > > +
> > > >
> > > > As this already seems to be git dependent, perhaps
> > >
> > > It's quite rare to see a non git generated diff these days.
> > >
> > > > it's easier to read with a single line test like:
> > > >
> > > >                 if ($line =~ m{^\s*create mode\s*\d+\s*Documentation/devicetree/bindings/.*\.txt$}) {
> > > >                         etc...
> > > >                 }
> > >
> > > I frequently do 'git show $commit | scripts/checkpatch.pl' and this
> > > doesn't work with that. I really should have a '--pretty=email' in
> > > there, but I just ignore the commit msg warnings. In any case, that
> > > still doesn't help because there's no diffstat. There's probably some
> > > way to turn that on or just use git-format-patch, but really we want
> > > this to work with any git diff.
> >
> > I don't understand your argument against what I proposed at all.
>
> It is dependent on the commit message rather than the diff itself. I
> want it to work with or without a diffstat.
>
> > and btw:
> >
> > $ git format-patch -1 --stdout <commit> | ./scripts/checkpatch.pl
>
> Yes, I stated this was possible. My concern is there are lots of ways
> to generate a diff in git. My way works for *all* of them. Yours
> doesn't.

Joe, are you okay with this?

Rob

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

* Re: [PATCH] checkpatch: Warn if DT bindings are not in schema format
  2019-10-11 17:56         ` Rob Herring
@ 2019-10-11 18:02           ` Joe Perches
  2019-10-11 19:32             ` Rob Herring
  0 siblings, 1 reply; 9+ messages in thread
From: Joe Perches @ 2019-10-11 18:02 UTC (permalink / raw)
  To: Rob Herring; +Cc: devicetree, linux-kernel, Andy Whitcroft, Andrew Morton

On Fri, 2019-10-11 at 12:56 -0500, Rob Herring wrote:
> On Fri, Sep 27, 2019 at 10:39 AM Rob Herring <robh@kernel.org> wrote:
> > On Fri, Sep 27, 2019 at 9:29 AM Joe Perches <joe@perches.com> wrote:
> > > On Fri, 2019-09-27 at 09:02 -0500, Rob Herring wrote:
> > > > On Fri, Sep 13, 2019 at 4:48 PM Joe Perches <joe@perches.com> wrote:
> > > > > On Fri, 2019-09-13 at 16:13 -0500, Rob Herring wrote:
> > > > > > DT bindings are moving to using a json-schema based schema format
> > > > > > instead of freeform text. Add a checkpatch.pl check to encourage using
> > > > > > the schema for new bindings. It's not yet a requirement, but is
> > > > > > progressively being required by some maintainers.
> > > > > []
> > > > > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > > > > []
> > > > > > @@ -2822,6 +2822,14 @@ sub process {
> > > > > >                            "added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr);
> > > > > >               }
> > > > > > 
> > > > > > +# Check for adding new DT bindings not in schema format
> > > > > > +             if (!$in_commit_log &&
> > > > > > +                 ($line =~ /^new file mode\s*\d+\s*$/) &&
> > > > > > +                 ($realfile =~ m@^Documentation/devicetree/bindings/.*\.txt$@)) {
> > > > > > +                     WARN("DT_SCHEMA_BINDING_PATCH",
> > > > > > +                          "DT bindings should be in DT schema format. See: Documentation/devicetree/writing-schema.rst\n");
> > > > > > +             }
> > > > > > +
> > > > > 
> > > > > As this already seems to be git dependent, perhaps
> > > > 
> > > > It's quite rare to see a non git generated diff these days.
> > > > 
> > > > > it's easier to read with a single line test like:
> > > > > 
> > > > >                 if ($line =~ m{^\s*create mode\s*\d+\s*Documentation/devicetree/bindings/.*\.txt$}) {
> > > > >                         etc...
> > > > >                 }
> > > > 
> > > > I frequently do 'git show $commit | scripts/checkpatch.pl' and this
> > > > doesn't work with that. I really should have a '--pretty=email' in
> > > > there, but I just ignore the commit msg warnings. In any case, that
> > > > still doesn't help because there's no diffstat. There's probably some
> > > > way to turn that on or just use git-format-patch, but really we want
> > > > this to work with any git diff.
> > > 
> > > I don't understand your argument against what I proposed at all.
> > 
> > It is dependent on the commit message rather than the diff itself. I
> > want it to work with or without a diffstat.
> > 
> > > and btw:
> > > 
> > > $ git format-patch -1 --stdout <commit> | ./scripts/checkpatch.pl
> > 
> > Yes, I stated this was possible. My concern is there are lots of ways
> > to generate a diff in git. My way works for *all* of them. Yours
> > doesn't.
> 
> Joe, are you okay with this?

Sure, Andrew Morton does most of the checkpatch upstreaming, but
if you want to send your own pull request, I've no objection.

> Rob


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

* Re: [PATCH] checkpatch: Warn if DT bindings are not in schema format
  2019-10-11 18:02           ` Joe Perches
@ 2019-10-11 19:32             ` Rob Herring
  0 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2019-10-11 19:32 UTC (permalink / raw)
  To: Joe Perches; +Cc: devicetree, linux-kernel, Andy Whitcroft, Andrew Morton

On Fri, Oct 11, 2019 at 1:02 PM Joe Perches <joe@perches.com> wrote:
>
> On Fri, 2019-10-11 at 12:56 -0500, Rob Herring wrote:
> > On Fri, Sep 27, 2019 at 10:39 AM Rob Herring <robh@kernel.org> wrote:
> > > On Fri, Sep 27, 2019 at 9:29 AM Joe Perches <joe@perches.com> wrote:
> > > > On Fri, 2019-09-27 at 09:02 -0500, Rob Herring wrote:
> > > > > On Fri, Sep 13, 2019 at 4:48 PM Joe Perches <joe@perches.com> wrote:
> > > > > > On Fri, 2019-09-13 at 16:13 -0500, Rob Herring wrote:
> > > > > > > DT bindings are moving to using a json-schema based schema format
> > > > > > > instead of freeform text. Add a checkpatch.pl check to encourage using
> > > > > > > the schema for new bindings. It's not yet a requirement, but is
> > > > > > > progressively being required by some maintainers.
> > > > > > []
> > > > > > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > > > > > []
> > > > > > > @@ -2822,6 +2822,14 @@ sub process {
> > > > > > >                            "added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr);
> > > > > > >               }
> > > > > > >
> > > > > > > +# Check for adding new DT bindings not in schema format
> > > > > > > +             if (!$in_commit_log &&
> > > > > > > +                 ($line =~ /^new file mode\s*\d+\s*$/) &&
> > > > > > > +                 ($realfile =~ m@^Documentation/devicetree/bindings/.*\.txt$@)) {
> > > > > > > +                     WARN("DT_SCHEMA_BINDING_PATCH",
> > > > > > > +                          "DT bindings should be in DT schema format. See: Documentation/devicetree/writing-schema.rst\n");
> > > > > > > +             }
> > > > > > > +
> > > > > >
> > > > > > As this already seems to be git dependent, perhaps
> > > > >
> > > > > It's quite rare to see a non git generated diff these days.
> > > > >
> > > > > > it's easier to read with a single line test like:
> > > > > >
> > > > > >                 if ($line =~ m{^\s*create mode\s*\d+\s*Documentation/devicetree/bindings/.*\.txt$}) {
> > > > > >                         etc...
> > > > > >                 }
> > > > >
> > > > > I frequently do 'git show $commit | scripts/checkpatch.pl' and this
> > > > > doesn't work with that. I really should have a '--pretty=email' in
> > > > > there, but I just ignore the commit msg warnings. In any case, that
> > > > > still doesn't help because there's no diffstat. There's probably some
> > > > > way to turn that on or just use git-format-patch, but really we want
> > > > > this to work with any git diff.
> > > >
> > > > I don't understand your argument against what I proposed at all.
> > >
> > > It is dependent on the commit message rather than the diff itself. I
> > > want it to work with or without a diffstat.
> > >
> > > > and btw:
> > > >
> > > > $ git format-patch -1 --stdout <commit> | ./scripts/checkpatch.pl
> > >
> > > Yes, I stated this was possible. My concern is there are lots of ways
> > > to generate a diff in git. My way works for *all* of them. Yours
> > > doesn't.
> >
> > Joe, are you okay with this?
>
> Sure, Andrew Morton does most of the checkpatch upstreaming, but
> if you want to send your own pull request, I've no objection.

Thanks, I've applied this to the DT tree.

Rob

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

end of thread, other threads:[~2019-10-11 19:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-13 21:13 [PATCH] checkpatch: Warn if DT bindings are not in schema format Rob Herring
2019-09-13 21:48 ` Joe Perches
2019-09-16 18:21   ` Rob Herring
2019-09-27 14:02   ` Rob Herring
2019-09-27 14:29     ` Joe Perches
2019-09-27 15:39       ` Rob Herring
2019-10-11 17:56         ` Rob Herring
2019-10-11 18:02           ` Joe Perches
2019-10-11 19:32             ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).