From patchwork Tue Mar 9 11:21:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 396982 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4035AC433E0 for ; Tue, 9 Mar 2021 11:23:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EDFDA65256 for ; Tue, 9 Mar 2021 11:22:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229851AbhCILWX (ORCPT ); Tue, 9 Mar 2021 06:22:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229520AbhCILV4 (ORCPT ); Tue, 9 Mar 2021 06:21:56 -0500 Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [IPv6:2a02:1800:120:4::f00:13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E64EC06174A for ; Tue, 9 Mar 2021 03:21:53 -0800 (PST) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:cc57:dd66:c63b:c8e4]) by baptiste.telenet-ops.be with bizsmtp id eBMr2400e1C546401BMs41; Tue, 09 Mar 2021 12:21:52 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lJaQx-006Gg4-J8; Tue, 09 Mar 2021 12:21:51 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1lJaQx-009giZ-50; Tue, 09 Mar 2021 12:21:51 +0100 From: Geert Uytterhoeven To: Rob Herring Cc: Masahiro Yamada , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] [RFC] dt-bindings: Consider DT_SCHEMA_FILES when finding all json-schema Date: Tue, 9 Mar 2021 12:21:48 +0100 Message-Id: <20210309112148.2309116-1-geert+renesas@glider.be> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Setting DT_SCHEMA_FILES allows the user to restrict the "dt_binding_check" make target to a specified set of DT binding files. However, yamllint is still run on all available files, which can take quite some time. Fix this by changing "find_cmd" to only return the specified files. Note that this also affects the "cmd_chk_bindings" and "cmd_mk_schema" rules. This reduces the execution time of make dt_binding_check DT_SCHEMA_FILES=/path/to/json/schema/file from ca. 22 to less than 2 seconds on an i7-8700K. Signed-off-by: Geert Uytterhoeven --- Should this be restricted to cmd_yamllint? I'm not sure which users of find_cmd do and do not need all files. --- Documentation/devicetree/bindings/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile index 780e5618ec0ae2fc..60ac03bade2da0ad 100644 --- a/Documentation/devicetree/bindings/Makefile +++ b/Documentation/devicetree/bindings/Makefile @@ -22,10 +22,18 @@ $(obj)/%.example.dts: $(src)/%.yaml check_dtschema_version FORCE # Use full schemas when checking %.example.dts DT_TMP_SCHEMA := $(obj)/processed-schema-examples.json +ifeq ($(DT_SCHEMA_FILES),) + find_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \ -name 'processed-schema*' ! \ -name '*.example.dt.yaml' \) +else + +find_cmd = echo $(addprefix $(srctree)/, $(DT_SCHEMA_FILES)) + +endif + quiet_cmd_yamllint = LINT $(src) cmd_yamllint = ($(find_cmd) | \ xargs $(DT_SCHEMA_LINT) -f parsable -c $(srctree)/$(src)/.yamllint) || true