linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] dt-bindings: Add a minimum version check for dtschema
@ 2020-04-20 22:49 Rob Herring
  2020-04-21  0:49 ` Masahiro Yamada
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Herring @ 2020-04-20 22:49 UTC (permalink / raw)
  To: devicetree; +Cc: linux-kernel, Masahiro Yamada

The dtschema package must be somewhat up to date as the tools and
meta-schema checks are still evolving. Implement a version check,
so this can be enforced. This will help ensure new schema submissions
get checked against the latest meta-schemas.

Cc: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
v3:
 - Drop leading '0' in version month
 - Rework with Masahiro's shell commands

v2:
 - Use a build rule for the version check instead
---
 Documentation/devicetree/bindings/Makefile | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile
index 1df680d07461..67b0969281da 100644
--- a/Documentation/devicetree/bindings/Makefile
+++ b/Documentation/devicetree/bindings/Makefile
@@ -3,11 +3,19 @@ DT_DOC_CHECKER ?= dt-doc-validate
 DT_EXTRACT_EX ?= dt-extract-example
 DT_MK_SCHEMA ?= dt-mk-schema
 
+DT_SCHEMA_MIN_VERSION = 2020.4
+
+PHONY += check_dtschema_version
+check_dtschema_version:
+	@{ echo $(DT_SCHEMA_MIN_VERSION); \
+	$(DT_DOC_CHECKER) --version 2>/dev/null || echo 0; } | sort -VC || \
+	{ echo "ERROR: dtschema minimum version is v$(DT_SCHEMA_MIN_VERSION)" >&2; false; }
+
 quiet_cmd_chk_binding = CHKDT   $(patsubst $(srctree)/%,%,$<)
       cmd_chk_binding = $(DT_DOC_CHECKER) -u $(srctree)/$(src) $< ; \
                         $(DT_EXTRACT_EX) $< > $@
 
-$(obj)/%.example.dts: $(src)/%.yaml FORCE
+$(obj)/%.example.dts: $(src)/%.yaml check_dtschema_version FORCE
 	$(call if_changed,chk_binding)
 
 # Use full schemas when checking %.example.dts
@@ -34,11 +42,11 @@ override DTC_FLAGS := \
 	-Wno-avoid_unnecessary_addr_size \
 	-Wno-graph_child_address
 
-$(obj)/processed-schema-examples.yaml: $(DT_DOCS) FORCE
+$(obj)/processed-schema-examples.yaml: $(DT_DOCS) check_dtschema_version FORCE
 	$(call if_changed,mk_schema)
 
 $(obj)/processed-schema.yaml: DT_MK_SCHEMA_FLAGS := -u
-$(obj)/processed-schema.yaml: $(DT_SCHEMA_FILES) FORCE
+$(obj)/processed-schema.yaml: $(DT_SCHEMA_FILES) check_dtschema_version FORCE
 	$(call if_changed,mk_schema)
 
 extra-y += processed-schema.yaml
-- 
2.20.1


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

* Re: [PATCH v3] dt-bindings: Add a minimum version check for dtschema
  2020-04-20 22:49 [PATCH v3] dt-bindings: Add a minimum version check for dtschema Rob Herring
@ 2020-04-21  0:49 ` Masahiro Yamada
  0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2020-04-21  0:49 UTC (permalink / raw)
  To: Rob Herring; +Cc: DTML, Linux Kernel Mailing List

On Tue, Apr 21, 2020 at 7:49 AM Rob Herring <robh@kernel.org> wrote:
>
> The dtschema package must be somewhat up to date as the tools and
> meta-schema checks are still evolving. Implement a version check,
> so this can be enforced. This will help ensure new schema submissions
> get checked against the latest meta-schemas.
>
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Signed-off-by: Rob Herring <robh@kernel.org>

Please replace Cc with:

Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>


> ---
> v3:
>  - Drop leading '0' in version month
>  - Rework with Masahiro's shell commands
>
> v2:
>  - Use a build rule for the version check instead
> ---
>  Documentation/devicetree/bindings/Makefile | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile
> index 1df680d07461..67b0969281da 100644
> --- a/Documentation/devicetree/bindings/Makefile
> +++ b/Documentation/devicetree/bindings/Makefile
> @@ -3,11 +3,19 @@ DT_DOC_CHECKER ?= dt-doc-validate
>  DT_EXTRACT_EX ?= dt-extract-example
>  DT_MK_SCHEMA ?= dt-mk-schema
>
> +DT_SCHEMA_MIN_VERSION = 2020.4
> +
> +PHONY += check_dtschema_version
> +check_dtschema_version:
> +       @{ echo $(DT_SCHEMA_MIN_VERSION); \
> +       $(DT_DOC_CHECKER) --version 2>/dev/null || echo 0; } | sort -VC || \
> +       { echo "ERROR: dtschema minimum version is v$(DT_SCHEMA_MIN_VERSION)" >&2; false; }
> +
>  quiet_cmd_chk_binding = CHKDT   $(patsubst $(srctree)/%,%,$<)
>        cmd_chk_binding = $(DT_DOC_CHECKER) -u $(srctree)/$(src) $< ; \
>                          $(DT_EXTRACT_EX) $< > $@
>
> -$(obj)/%.example.dts: $(src)/%.yaml FORCE
> +$(obj)/%.example.dts: $(src)/%.yaml check_dtschema_version FORCE
>         $(call if_changed,chk_binding)
>
>  # Use full schemas when checking %.example.dts
> @@ -34,11 +42,11 @@ override DTC_FLAGS := \
>         -Wno-avoid_unnecessary_addr_size \
>         -Wno-graph_child_address
>
> -$(obj)/processed-schema-examples.yaml: $(DT_DOCS) FORCE
> +$(obj)/processed-schema-examples.yaml: $(DT_DOCS) check_dtschema_version FORCE
>         $(call if_changed,mk_schema)
>
>  $(obj)/processed-schema.yaml: DT_MK_SCHEMA_FLAGS := -u
> -$(obj)/processed-schema.yaml: $(DT_SCHEMA_FILES) FORCE
> +$(obj)/processed-schema.yaml: $(DT_SCHEMA_FILES) check_dtschema_version FORCE
>         $(call if_changed,mk_schema)
>
>  extra-y += processed-schema.yaml
> --
> 2.20.1
>


-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2020-04-21  0:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-20 22:49 [PATCH v3] dt-bindings: Add a minimum version check for dtschema Rob Herring
2020-04-21  0:49 ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).