Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kbuild: Enable DT undocumented compatible checks

dt-validate has an option to warn on any compatible strings which don't
match any schema. The option has recently been improved to fix false
positives, so let's enable the option. This is useful for tracking
compatibles which are undocumented or not yet converted to DT schema.
Previously, the only check of undocumented compatible strings has been
an imperfect checkpatch.pl check.

The option is enabled by default for 'dtbs_check'. This will add more
warnings, but some platforms are down to only a handful of these
warnings (good job!).

There's about 100 cases in the binding examples, so the option is
disabled until these are fixed. In the meantime, they can be checked
with:

make DT_CHECKER_FLAGS=-m dt_binding_check

Cc: Maxime Ripard <mripard@kernel.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: linux-kbuild@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210311233640.1581526-2-robh@kernel.org

+5 -1
+3
Documentation/devicetree/bindings/Makefile
··· 55 55 -Wno-graph_child_address \ 56 56 -Wno-interrupt_provider 57 57 58 + # Disable undocumented compatible checks until warning free 59 + override DT_CHECKER_FLAGS ?= 60 + 58 61 $(obj)/processed-schema-examples.json: $(DT_DOCS) $(src)/.yamllint check_dtschema_version FORCE 59 62 $(call if_changed_rule,chkdt) 60 63
+2 -1
scripts/Makefile.lib
··· 339 339 $(call if_changed_dep,dtc) 340 340 341 341 DT_CHECKER ?= dt-validate 342 + DT_CHECKER_FLAGS ?= $(if $(DT_SCHEMA_FILES),,-m) 342 343 DT_BINDING_DIR := Documentation/devicetree/bindings 343 344 # DT_TMP_SCHEMA may be overridden from Documentation/devicetree/bindings/Makefile 344 345 DT_TMP_SCHEMA ?= $(objtree)/$(DT_BINDING_DIR)/processed-schema.json 345 346 346 347 quiet_cmd_dtb_check = CHECK $@ 347 - cmd_dtb_check = $(DT_CHECKER) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@ 348 + cmd_dtb_check = $(DT_CHECKER) $(DT_CHECKER_FLAGS) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@ 348 349 349 350 define rule_dtc 350 351 $(call cmd_and_fixdep,dtc)