From: Masahiro Yamada <masahiroy@kernel.org>
To: Rob Herring <robh+dt@kernel.org>,
Frank Rowand <frowand.list@gmail.com>,
devicetree@vger.kernel.org
Cc: linux-kbuild@vger.kernel.org,
Masahiro Yamada <masahiroy@kernel.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Nathan Chancellor <nathan@kernel.org>,
Sam Protsenko <semen.protsenko@linaro.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH] dt-bindings: fix wrong use of if_changed_rule
Date: Thu, 18 Aug 2022 00:20:26 +0900 [thread overview]
Message-ID: <20220817152027.16928-1-masahiroy@kernel.org> (raw)
The intent for if_changed_rule is to re-run the rule when the command
line is changed, but this if_changed_rule does not do anything for it.
$(cmd-check) for this rule is always empty because:
[1] $(cmd_$@) is empty because .processed-schema.json.cmd does not exist
[2] $(cmd_$1) is empty because cmd_chkdt is not defined
To address [1], use cmd_and_cmdsave instead of cmd.
To address [2], rename rule_chkdt to rule_mk_schema so that the stem
parts of cmd_* and rule_* match, like commit 7a0496056064 ("kbuild:
fix DT binding schema rule to detect command line changes").
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
Another possibility might be to split out yamllint and chk_bindings
as standalone build rules instead of running them as a side-effect
of the schema build. (but it it up to Rob's preference)
Documentation/devicetree/bindings/Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile
index 1eaccf135b30..bb40205689ea 100644
--- a/Documentation/devicetree/bindings/Makefile
+++ b/Documentation/devicetree/bindings/Makefile
@@ -46,10 +46,10 @@ quiet_cmd_mk_schema = SCHEMA $@
$(DT_MK_SCHEMA) -j $(DT_MK_SCHEMA_FLAGS) @$$f > $@ ; \
rm -f $$f
-define rule_chkdt
+define rule_mk_schema
$(if $(DT_SCHEMA_LINT),$(call cmd,yamllint),)
$(call cmd,chk_bindings)
- $(call cmd,mk_schema)
+ $(call cmd_and_savecmd,mk_schema)
endef
DT_DOCS = $(patsubst $(srctree)/%,%,$(shell $(find_all_cmd)))
@@ -65,7 +65,7 @@ override DTC_FLAGS := \
override DT_CHECKER_FLAGS ?=
$(obj)/processed-schema.json: $(DT_DOCS) $(src)/.yamllint check_dtschema_version FORCE
- $(call if_changed_rule,chkdt)
+ $(call if_changed_rule,mk_schema)
always-y += processed-schema.json
always-$(CHECK_DT_BINDING) += $(patsubst $(srctree)/$(src)/%.yaml,%.example.dts, $(CHK_DT_DOCS))
--
2.34.1
next reply other threads:[~2022-08-17 15:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-17 15:20 Masahiro Yamada [this message]
2022-08-24 0:23 ` [PATCH] dt-bindings: fix wrong use of if_changed_rule Rob Herring
2022-08-24 15:12 ` Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220817152027.16928-1-masahiroy@kernel.org \
--to=masahiroy@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=geert+renesas@glider.be \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=robh+dt@kernel.org \
--cc=semen.protsenko@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox