Skip to contentSkip to conversation

checkpatch: filter null file for dt-binding check

PATCH In review Zong Li 1 participant 2 messages Jun 19, 2024 – Jul 25, 2024 Checkpatch

lore
Share & tools
lore

Zong Li

author
#0 lore raw

PATCH 1/1 checkpatch: filter null file for dt-binding check

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

---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
index 2b812210b412..ac59a48162d2 100755
@@ -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/)@;
Signature · 1 line
2.17.1
author
#1 lore raw
Quoted 24 lines · Zong Li

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

---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -2
index 2b812210b412..ac59a48162d2 100755
@@ -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/)@;
--
Quoted 2 lines

2.17.1

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