mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] checkpatch: Don't emit unified-diff error for rename-only patches
@ 2016-12-05 23:22 Andrew Jeffery
  2016-12-05 23:51 ` Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Jeffery @ 2016-12-05 23:22 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches; +Cc: Andrew Jeffery, linux-kernel

I generated a patch with `git format-patch` which checkpatch thinks is
invalid:

    $ ./scripts/checkpatch.pl lpc-dt/0006-mfd-dt-Move-syscon-bindings-to-syscon-subdirectory.patch
    WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
     Documentation/devicetree/bindings/mfd/{ => syscon}/aspeed-scu.txt         | 0

    ERROR: Does not appear to be a unified-diff format patch

    total: 1 errors, 1 warnings, 0 lines checked

    NOTE: For some of the reported defects, checkpatch may be able to
          mechanically convert to the typical style using --fix or --fix-inplace.

    lpc-dt/0006-mfd-dt-Move-syscon-bindings-to-syscon-subdirectory.patch has style problems, please review.

    NOTE: If any of the errors are false positives, please report
          them to the maintainer, see CHECKPATCH in MAINTAINERS.

The patch in question was all renames with no edits, giving 100% similarity and
thus no diff markers.

    $ cat lpc-dt/0006-mfd-dt-Move-syscon-bindings-to-syscon-subdirectory.patch
    From 325409d9ceca0aa8371dd1f7c7cf4e4b8a92487e Mon Sep 17 00:00:00 2001
    From: Andrew Jeffery <andrew@aj.id.au>
    Date: Fri, 2 Dec 2016 12:26:21 +1030
    Subject: [PATCH 6/6] mfd: dt: Move syscon bindings to syscon subdirectory

    The use of syscons is growing, lets collate them in their own part of
    the bindings tree.

    Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
    ---
     Documentation/devicetree/bindings/mfd/{ => syscon}/aspeed-scu.txt         | 0
     Documentation/devicetree/bindings/mfd/{ => syscon}/atmel-gpbr.txt         | 0
     Documentation/devicetree/bindings/mfd/{ => syscon}/atmel-matrix.txt       | 0
     Documentation/devicetree/bindings/mfd/{ => syscon}/atmel-smc.txt          | 0
     Documentation/devicetree/bindings/mfd/{ => syscon}/qcom,tcsr.txt          | 0
     Documentation/devicetree/bindings/mfd/{ => syscon}/syscon.txt             | 0
     .../devicetree/bindings/mfd/{ => syscon}/ti-keystone-devctrl.txt          | 0
     7 files changed, 0 insertions(+), 0 deletions(-)
     rename Documentation/devicetree/bindings/mfd/{ => syscon}/aspeed-scu.txt (100%)
     rename Documentation/devicetree/bindings/mfd/{ => syscon}/atmel-gpbr.txt (100%)
     rename Documentation/devicetree/bindings/mfd/{ => syscon}/atmel-matrix.txt (100%)
     rename Documentation/devicetree/bindings/mfd/{ => syscon}/atmel-smc.txt (100%)
     rename Documentation/devicetree/bindings/mfd/{ => syscon}/qcom,tcsr.txt (100%)
     rename Documentation/devicetree/bindings/mfd/{ => syscon}/syscon.txt (100%)
     rename Documentation/devicetree/bindings/mfd/{ => syscon}/ti-keystone-devctrl.txt (100%)

    diff --git a/Documentation/devicetree/bindings/mfd/aspeed-scu.txt b/Documentation/devicetree/bindings/mfd/syscon/aspeed-scu.txt
    similarity index 100%
    rename from Documentation/devicetree/bindings/mfd/aspeed-scu.txt
    rename to Documentation/devicetree/bindings/mfd/syscon/aspeed-scu.txt
    diff --git a/Documentation/devicetree/bindings/mfd/atmel-gpbr.txt b/Documentation/devicetree/bindings/mfd/syscon/atmel-gpbr.txt
    similarity index 100%
    rename from Documentation/devicetree/bindings/mfd/atmel-gpbr.txt
    rename to Documentation/devicetree/bindings/mfd/syscon/atmel-gpbr.txt
    diff --git a/Documentation/devicetree/bindings/mfd/atmel-matrix.txt b/Documentation/devicetree/bindings/mfd/syscon/atmel-matrix.txt
    similarity index 100%
    rename from Documentation/devicetree/bindings/mfd/atmel-matrix.txt
    rename to Documentation/devicetree/bindings/mfd/syscon/atmel-matrix.txt
    diff --git a/Documentation/devicetree/bindings/mfd/atmel-smc.txt b/Documentation/devicetree/bindings/mfd/syscon/atmel-smc.txt
    similarity index 100%
    rename from Documentation/devicetree/bindings/mfd/atmel-smc.txt
    rename to Documentation/devicetree/bindings/mfd/syscon/atmel-smc.txt
    diff --git a/Documentation/devicetree/bindings/mfd/qcom,tcsr.txt b/Documentation/devicetree/bindings/mfd/syscon/qcom,tcsr.txt
    similarity index 100%
    rename from Documentation/devicetree/bindings/mfd/qcom,tcsr.txt
    rename to Documentation/devicetree/bindings/mfd/syscon/qcom,tcsr.txt
    diff --git a/Documentation/devicetree/bindings/mfd/syscon.txt b/Documentation/devicetree/bindings/mfd/syscon/syscon.txt
    similarity index 100%
    rename from Documentation/devicetree/bindings/mfd/syscon.txt
    rename to Documentation/devicetree/bindings/mfd/syscon/syscon.txt
    diff --git a/Documentation/devicetree/bindings/mfd/ti-keystone-devctrl.txt b/Documentation/devicetree/bindings/mfd/syscon/ti-keystone-devctrl.txt
    similarity index 100%
    rename from Documentation/devicetree/bindings/mfd/ti-keystone-devctrl.txt
    rename to Documentation/devicetree/bindings/mfd/syscon/ti-keystone-devctrl.txt
    --
    2.9.3

Set '$is_patch = 1;' in the add/remove/rename detection to avoid
generating spurious warnings.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
---
 scripts/checkpatch.pl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a8368d1c4348..9a434eb4aac4 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2589,6 +2589,7 @@ sub process {
 		     $line =~ /^rename (?:from|to) [\w\/\.\-]+\s*$/ ||
 		     ($line =~ /\{\s*([\w\/\.\-]*)\s*\=\>\s*([\w\/\.\-]*)\s*\}/ &&
 		      (defined($1) || defined($2))))) {
+			$is_patch = 1;
 			$reported_maintainer_file = 1;
 			WARN("FILE_PATH_CHANGES",
 			     "added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr);
-- 
2.9.3

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

* Re: [PATCH] checkpatch: Don't emit unified-diff error for rename-only patches
  2016-12-05 23:22 [PATCH] checkpatch: Don't emit unified-diff error for rename-only patches Andrew Jeffery
@ 2016-12-05 23:51 ` Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2016-12-05 23:51 UTC (permalink / raw)
  To: Andrew Jeffery, Andy Whitcroft, Andrew Morton; +Cc: linux-kernel

On Tue, 2016-12-06 at 10:22 +1100, Andrew Jeffery wrote:
> I generated a patch with `git format-patch` which checkpatch thinks is
> invalid:
> 
>     $ ./scripts/checkpatch.pl lpc-dt/0006-mfd-dt-Move-syscon-bindings-to-syscon-subdirectory.patch
>     WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
>      Documentation/devicetree/bindings/mfd/{ => syscon}/aspeed-scu.txt         | 0
> 
>     ERROR: Does not appear to be a unified-diff format patch
> 
>     total: 1 errors, 1 warnings, 0 lines checked
> 
>     NOTE: For some of the reported defects, checkpatch may be able to
>           mechanically convert to the typical style using --fix or --fix-inplace.
> 
>     lpc-dt/0006-mfd-dt-Move-syscon-bindings-to-syscon-subdirectory.patch has style problems, please review.
> 
>     NOTE: If any of the errors are false positives, please report
>           them to the maintainer, see CHECKPATCH in MAINTAINERS.
> 
> The patch in question was all renames with no edits, giving 100% similarity and
> thus no diff markers.
> 
>     $ cat lpc-dt/0006-mfd-dt-Move-syscon-bindings-to-syscon-subdirectory.patch
>     From 325409d9ceca0aa8371dd1f7c7cf4e4b8a92487e Mon Sep 17 00:00:00 2001
>     From: Andrew Jeffery <andrew@aj.id.au>
>     Date: Fri, 2 Dec 2016 12:26:21 +1030
>     Subject: [PATCH 6/6] mfd: dt: Move syscon bindings to syscon subdirectory
> 
>     The use of syscons is growing, lets collate them in their own part of
>     the bindings tree.
> 
>     Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
>     ---
>      Documentation/devicetree/bindings/mfd/{ => syscon}/aspeed-scu.txt         | 0
>      Documentation/devicetree/bindings/mfd/{ => syscon}/atmel-gpbr.txt         | 0
>      Documentation/devicetree/bindings/mfd/{ => syscon}/atmel-matrix.txt       | 0
>      Documentation/devicetree/bindings/mfd/{ => syscon}/atmel-smc.txt          | 0
>      Documentation/devicetree/bindings/mfd/{ => syscon}/qcom,tcsr.txt          | 0
>      Documentation/devicetree/bindings/mfd/{ => syscon}/syscon.txt             | 0
>      .../devicetree/bindings/mfd/{ => syscon}/ti-keystone-devctrl.txt          | 0
>      7 files changed, 0 insertions(+), 0 deletions(-)
>      rename Documentation/devicetree/bindings/mfd/{ => syscon}/aspeed-scu.txt (100%)
>      rename Documentation/devicetree/bindings/mfd/{ => syscon}/atmel-gpbr.txt (100%)
>      rename Documentation/devicetree/bindings/mfd/{ => syscon}/atmel-matrix.txt (100%)
>      rename Documentation/devicetree/bindings/mfd/{ => syscon}/atmel-smc.txt (100%)
>      rename Documentation/devicetree/bindings/mfd/{ => syscon}/qcom,tcsr.txt (100%)
>      rename Documentation/devicetree/bindings/mfd/{ => syscon}/syscon.txt (100%)
>      rename Documentation/devicetree/bindings/mfd/{ => syscon}/ti-keystone-devctrl.txt (100%)
> 
>     diff --git a/Documentation/devicetree/bindings/mfd/aspeed-scu.txt b/Documentation/devicetree/bindings/mfd/syscon/aspeed-scu.txt
>     similarity index 100%
>     rename from Documentation/devicetree/bindings/mfd/aspeed-scu.txt
>     rename to Documentation/devicetree/bindings/mfd/syscon/aspeed-scu.txt
>     diff --git a/Documentation/devicetree/bindings/mfd/atmel-gpbr.txt b/Documentation/devicetree/bindings/mfd/syscon/atmel-gpbr.txt
>     similarity index 100%
>     rename from Documentation/devicetree/bindings/mfd/atmel-gpbr.txt
>     rename to Documentation/devicetree/bindings/mfd/syscon/atmel-gpbr.txt
>     diff --git a/Documentation/devicetree/bindings/mfd/atmel-matrix.txt b/Documentation/devicetree/bindings/mfd/syscon/atmel-matrix.txt
>     similarity index 100%
>     rename from Documentation/devicetree/bindings/mfd/atmel-matrix.txt
>     rename to Documentation/devicetree/bindings/mfd/syscon/atmel-matrix.txt
>     diff --git a/Documentation/devicetree/bindings/mfd/atmel-smc.txt b/Documentation/devicetree/bindings/mfd/syscon/atmel-smc.txt
>     similarity index 100%
>     rename from Documentation/devicetree/bindings/mfd/atmel-smc.txt
>     rename to Documentation/devicetree/bindings/mfd/syscon/atmel-smc.txt
>     diff --git a/Documentation/devicetree/bindings/mfd/qcom,tcsr.txt b/Documentation/devicetree/bindings/mfd/syscon/qcom,tcsr.txt
>     similarity index 100%
>     rename from Documentation/devicetree/bindings/mfd/qcom,tcsr.txt
>     rename to Documentation/devicetree/bindings/mfd/syscon/qcom,tcsr.txt
>     diff --git a/Documentation/devicetree/bindings/mfd/syscon.txt b/Documentation/devicetree/bindings/mfd/syscon/syscon.txt
>     similarity index 100%
>     rename from Documentation/devicetree/bindings/mfd/syscon.txt
>     rename to Documentation/devicetree/bindings/mfd/syscon/syscon.txt
>     diff --git a/Documentation/devicetree/bindings/mfd/ti-keystone-devctrl.txt b/Documentation/devicetree/bindings/mfd/syscon/ti-keystone-devctrl.txt
>     similarity index 100%
>     rename from Documentation/devicetree/bindings/mfd/ti-keystone-devctrl.txt
>     rename to Documentation/devicetree/bindings/mfd/syscon/ti-keystone-devctrl.txt
>     --
>     2.9.3
> 
> Set '$is_patch = 1;' in the add/remove/rename detection to avoid
> generating spurious warnings.
> 
> Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
> ---
>  scripts/checkpatch.pl | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index a8368d1c4348..9a434eb4aac4 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2589,6 +2589,7 @@ sub process {
>  		     $line =~ /^rename (?:from|to) [\w\/\.\-]+\s*$/ ||
>  		     ($line =~ /\{\s*([\w\/\.\-]*)\s*\=\>\s*([\w\/\.\-]*)\s*\}/ &&
>  		      (defined($1) || defined($2))))) {
> +			$is_patch = 1;
>  			$reported_maintainer_file = 1;
>  			WARN("FILE_PATH_CHANGES",
>  			     "added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr);

Seems sensible, thanks.

Acked-by: Joe Perches <joe@perches.com>

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

end of thread, other threads:[~2016-12-05 23:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-05 23:22 [PATCH] checkpatch: Don't emit unified-diff error for rename-only patches Andrew Jeffery
2016-12-05 23:51 ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome