History

checkpatch: Warn if DT bindings are not in schema format

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.

Rob Herring committed 7 years ago

Commit e400edb1 parent a4dc1ca1 file · +8 −0Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+8−0
@@ -2826,6 +2826,14 @@ sub process { · 2825 unmodified lines
2826 "added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr);2826 "added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr);
2827 }2827 }
2828 2828
2829# Check for adding new DT bindings not in schema format
2830 if (!$in_commit_log &&
2831 ($line =~ /^new file mode\s*\d+\s*$/) &&
2832 ($realfile =~ m@^Documentation/devicetree/bindings/.*\.txt$@)) {
2833 WARN("DT_SCHEMA_BINDING_PATCH",
2834 "DT bindings should be in DT schema format. See: Documentation/devicetree/writing-schema.rst\n");
2835 }
2836
2829# Check for wrappage within a valid hunk of the file2837# Check for wrappage within a valid hunk of the file
2830 if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) {2838 if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) {
2831 ERROR("CORRUPTED_PATCH",2839 ERROR("CORRUPTED_PATCH",