Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp140544lqe; Fri, 5 Apr 2024 15:56:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVpkIxT2LlfWHTbhVhW75+gslncghEAcCFVkacpWjutel+LH72FKdyz74d7QB9qC2NSDBulJ5hH8O0BUgEFwiFSj1UwOjc6YNRUNy+YRg== X-Google-Smtp-Source: AGHT+IFVAHe64Ned39pWsPODOCHR7VUb6SUqzjOPlGv5GYmWwymA9AgWKmbwHbQ0ZoWkyVyoOVgf X-Received: by 2002:a05:6358:7d17:b0:17e:89bb:e545 with SMTP id i23-20020a0563587d1700b0017e89bbe545mr2789973rwg.19.1712357808396; Fri, 05 Apr 2024 15:56:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712357808; cv=pass; d=google.com; s=arc-20160816; b=dRJi87vuFcAIqp0itINUbY7BOAxbGrO4/EqVNhPd+Vmn8DM1uV/xgD/9xAZHMSnUEN go+eIWe7/a6bYYp89dfblXOZ8MYZh+ZlXDcMwSjuWgcEw72Wa8LNTLhBhYk7WrOio/K3 hnqPH6YJf1eFQ2QBMARCMf8VzTZPVioBH3IMPcbjGIpPi7SKCekqtLhtuh64FpBhf5V1 o3bha9XLJDGN914dH3v3z2xu3exlUIdTvl13aB0oIuecCE0mUzrUXVYeYhXIBJli6pnP 3Hnn9knWZpgLvPNSalsTz1burRbT2pHAsDH7uKHqyTYgitRYDA7tsIDc55WgRuGd5dw4 o/9Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=CFinEMQ1zcDzIR2X9SwtI3VbYhZhDncnE+K+dELGkeo=; fh=yyhSJ7kJbelaT0zflq8pCNhUDvl607XpqkpdkJIFH54=; b=FAmhkp1w477RfgN0y0kV1vX5tMJVQdybRr2NUh8hswjzYE4moMyZ62l7MdP6v2UGUH vZMkWP/r9Exct/B9FVkZO1fpLCjRQyk+sRDpz8xo3ykEEGDPokSBvztrEPPdYNEG8hhh G5Z4Mqk8aqGjTiG/j+HctcAgS0sgiyyw7MQBIU91KLhVsELZ2//+EaufrbYPOVzf4+gR VfejIrU2fq4zJrSDIp6OHtomL6wiJxBERVLv1OhuV0Q8QuPdzD3eyTedKhjZXv+Ckk7L H5kwosoMQmeGof7ck1tgbNe/1lQjPabSwmJagZ4YBBBWhvqcsT4Dis6zB9mJkpbVcACX oteA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rPBzD9Gl; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-133695-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133695-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e27-20020a631e1b000000b005dcc078681dsi2026710pge.618.2024.04.05.15.56.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 15:56:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133695-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rPBzD9Gl; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-133695-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133695-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 102D5286CE5 for ; Fri, 5 Apr 2024 22:56:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B12863A29A; Fri, 5 Apr 2024 22:56:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rPBzD9Gl" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEAC7381C4; Fri, 5 Apr 2024 22:56:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712357777; cv=none; b=hZX4ODp71yRcIjj2ZcT15Oj6d/ShqFiNu/4xDP4BLremMZ+CkS8KLfq0Uay7lnGE5nDcgy60FpwQXEOdTyh0C1t47hzbqFwRw+ocGzlJLiiHiDuWvde5KJni9t7RymTTj+1k8v6K3db9JBYYTk9QqQJ2ab+lKpfCZwjt6lIOGbM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712357777; c=relaxed/simple; bh=NDgit/zD/XsJmhpf2nWroZgulljOwKs7JeTqVXmjuok=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=McSXFBKCrQ/yuB7z4S2r6jxsOq1MKFVl7l5Wsyjq0VvNEJb6fahhV9rSzqWWBwhZroSJdaBfKpwulRXnaRR4l/QoggEox/ocpHqfmZwIHru1UpSwXHirxI33SNorAbsRm3bkUmKphvCXAjJbSSpwoUcYHgSsxfG/lR+z5a8aWWY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rPBzD9Gl; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57BC3C433F1; Fri, 5 Apr 2024 22:56:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712357777; bh=NDgit/zD/XsJmhpf2nWroZgulljOwKs7JeTqVXmjuok=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=rPBzD9GlHEBvrwRwAJDdNaqgQ2+KSdSNETW0L4RPTvH7EbhEd9IA1U5Ak6jd3E/K6 Q9ezCJBaJCnmlf3jV8KI1+VJMJ0Q9JNmh8YjJg4Iugnb/0okphaXPUDiYEP1bf6UI3 LHy1bTEypUi2g2KDbdWQlTgTEw5mLO7v4gVwojyIxUlrILm5zrCGlPxrCdCzopmSfr watGoex8RFE+EQeNmSksg0RE9+FB1i+1ptTG6MhO16hTF5OD6y0r2lE4a9IXzh3frw A7kMq81ON5nFWQW53bU4aeJaKers89SlCO3O4o5BvapMFP499qRWb2Y4dQpD8CUH8O 3eboWiuj59shw== From: Rob Herring Date: Fri, 05 Apr 2024 17:56:02 -0500 Subject: [PATCH v2 2/3] dt-bindings: kbuild: Split targets out to separate rules Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240405-dt-kbuild-rework-v2-2-3a035caee357@kernel.org> References: <20240405-dt-kbuild-rework-v2-0-3a035caee357@kernel.org> In-Reply-To: <20240405-dt-kbuild-rework-v2-0-3a035caee357@kernel.org> To: Krzysztof Kozlowski , Conor Dooley , Masahiro Yamada , Nathan Chancellor , Nicolas Schier Cc: Dmitry Baryshkov , Marijn Suijten , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org X-Mailer: b4 0.13-dev Masahiro pointed out the use of if_changed_rule is incorrect and command line changes are not correctly accounted for. To fix this, split up the DT binding validation target, dt_binding_check, into multiple rules for each step: yamllint, schema validtion with meta-schema, and building the processed schema. One change in behavior is the yamllint or schema validation will be re-run again when there are warnings present. Reported-by: Masahiro Yamada Link: https://lore.kernel.org/all/20220817152027.16928-1-masahiroy@kernel.org/ Signed-off-by: Rob Herring --- v2: - Separated rework of build rules to fix if_changed_rule usage from addition of top-level build rules. --- Documentation/devicetree/bindings/Makefile | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile index 95f1436ebcd0..3779405269ab 100644 --- a/Documentation/devicetree/bindings/Makefile +++ b/Documentation/devicetree/bindings/Makefile @@ -37,11 +37,13 @@ CHK_DT_EXAMPLES := $(patsubst $(srctree)/%.yaml,%.example.dtb, $(shell $(find_cm quiet_cmd_yamllint = LINT $(src) cmd_yamllint = ($(find_cmd) | \ xargs -n200 -P$$(nproc) \ - $(DT_SCHEMA_LINT) -f parsable -c $(srctree)/$(src)/.yamllint >&2) || true + $(DT_SCHEMA_LINT) -f parsable -c $(srctree)/$(src)/.yamllint >&2) \ + && touch $@ || true -quiet_cmd_chk_bindings = CHKDT $@ +quiet_cmd_chk_bindings = CHKDT $(src) cmd_chk_bindings = ($(find_cmd) | \ - xargs -n200 -P$$(nproc) $(DT_DOC_CHECKER) -u $(srctree)/$(src)) || true + xargs -n200 -P$$(nproc) $(DT_DOC_CHECKER) -u $(srctree)/$(src)) \ + && touch $@ || true quiet_cmd_mk_schema = SCHEMA $@ cmd_mk_schema = f=$$(mktemp) ; \ @@ -49,12 +51,6 @@ quiet_cmd_mk_schema = SCHEMA $@ $(DT_MK_SCHEMA) -j $(DT_MK_SCHEMA_FLAGS) @$$f > $@ ; \ rm -f $$f -define rule_chkdt - $(if $(DT_SCHEMA_LINT),$(call cmd,yamllint),) - $(call cmd,chk_bindings) - $(call cmd,mk_schema) -endef - DT_DOCS = $(patsubst $(srctree)/%,%,$(shell $(find_all_cmd))) override DTC_FLAGS := \ @@ -64,8 +60,15 @@ override DTC_FLAGS := \ -Wno-unique_unit_address \ -Wunique_unit_address_if_enabled -$(obj)/processed-schema.json: $(DT_DOCS) $(src)/.yamllint check_dtschema_version FORCE - $(call if_changed_rule,chkdt) +$(obj)/processed-schema.json: $(DT_DOCS) check_dtschema_version FORCE + $(call if_changed,mk_schema) + +always-$(CHECK_DT_BINDING) += .dt-binding.checked .yamllint.checked +$(obj)/.yamllint.checked: $(DT_DOCS) $(src)/.yamllint FORCE + $(if $(DT_SCHEMA_LINT),$(call if_changed,yamllint),) + +$(obj)/.dt-binding.checked: $(DT_DOCS) FORCE + $(call if_changed,chk_bindings) always-y += processed-schema.json always-$(CHECK_DT_BINDING) += $(patsubst $(obj)/%,%, $(CHK_DT_EXAMPLES)) -- 2.43.0