[PATCH] checkpatch: filter null file for dt-binding check

Zong Li posted 1 patch 1 year, 7 months ago
scripts/checkpatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] checkpatch: filter null file for dt-binding check
Posted by Zong Li 1 year, 7 months ago
When removing a dt-bindings, checkpatch will catch the 'dev/null' file,
and think there is a non-dt-binding file. It causes fail because
/dev/null is not a dt-bindings

Signed-off-by: Zong Li <zong.li@sifive.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 2b812210b412..ac59a48162d2 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2896,7 +2896,7 @@ sub process {
 			}
 			$checklicenseline = 1;
 
-			if ($realfile !~ /^MAINTAINERS/) {
+			if (($realfile !~ /^MAINTAINERS/) && ($realfile !~ /^dev\/null$/)) {
 				my $last_binding_patch = $is_binding_patch;
 
 				$is_binding_patch = () = $realfile =~ m@^(?:Documentation/devicetree/|include/dt-bindings/)@;
-- 
2.17.1
Re: [PATCH] checkpatch: filter null file for dt-binding check
Posted by Zong Li 1 year, 6 months ago
On Wed, Jun 19, 2024 at 2:17 PM Zong Li <zong.li@sifive.com> wrote:
>
> When removing a dt-bindings, checkpatch will catch the 'dev/null' file,
> and think there is a non-dt-binding file. It causes fail because
> /dev/null is not a dt-bindings
>
> Signed-off-by: Zong Li <zong.li@sifive.com>
> ---
>  scripts/checkpatch.pl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 2b812210b412..ac59a48162d2 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2896,7 +2896,7 @@ sub process {
>                         }
>                         $checklicenseline = 1;
>
> -                       if ($realfile !~ /^MAINTAINERS/) {
> +                       if (($realfile !~ /^MAINTAINERS/) && ($realfile !~ /^dev\/null$/)) {
>                                 my $last_binding_patch = $is_binding_patch;
>
>                                 $is_binding_patch = () = $realfile =~ m@^(?:Documentation/devicetree/|include/dt-bindings/)@;
> --
> 2.17.1
>

Hi all,
I was wondering if this patch makes sense to you? Thanks