From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH v4 02/14] Makefile: Add common code to report deprecation
Date: Thu, 25 Mar 2021 21:24:33 +1300 [thread overview]
Message-ID: <20210325082445.519028-3-sjg@chromium.org> (raw)
In-Reply-To: <20210325082445.519028-1-sjg@chromium.org>
Add a function which can be called to report a migration problem. This
will make it easier to add new migration checks, since the logic and
strings are not spread out over 8 lines of code.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
(no changes since v1)
Makefile | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/Makefile b/Makefile
index b735a6ae6cd..063f88d3103 100644
--- a/Makefile
+++ b/Makefile
@@ -1017,6 +1017,33 @@ quiet_cmd_cfgcheck = CFGCHK $2
cmd_cfgcheck = $(srctree)/scripts/check-config.sh $2 \
$(srctree)/scripts/config_whitelist.txt $(srctree)
+# Concat the value of all the CONFIGs (result is 'y' or 'yy', etc. )
+got = $(foreach cfg,$(1),$($(cfg)))
+
+# expected value 'y for each one
+expect = $(foreach cfg,$(1),y)
+
+# Show a deprecation message
+# Args:
+# 1: List of CONFIG_DM_... to migrate to (e.g. "CONFIG_DM_MMC CONFIG_BLK")
+# 2: Name of component (e.g . "Ethernet drivers")
+# 3: Release deadline (e.g. "v202.07")
+# 4: Condition to require before checking (e.g. "$(CONFIG_NET)")
+# Note: Script avoids bash construct, hence the strange double 'if'
+# (patches welcome!)
+define deprecated
+ if [ -n "$(strip $(4))" ]; then if [ "$(got)" != "$(expect)" ]; then \
+ echo >&2 "===================== WARNING ======================"; \
+ echo >&2 "This board does not use $(firstword $(1)) (Driver Model"; \
+ echo >&2 "for $(2)). Please update the board to use"; \
+ echo >&2 "$(firstword $(1)) before the $(3) release. Failure to"; \
+ echo >&2 "update by the deadline may result in board removal."; \
+ echo >&2 "See doc/driver-model/migration.rst for more info."; \
+ echo >&2 "===================================================="; \
+ fi; fi
+
+endef
+
PHONY += inputs
inputs: $(INPUTS-y)
--
2.31.0.291.g576ba9dcdaf-goog
next prev parent reply other threads:[~2021-03-25 8:24 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-25 8:24 [PATCH v4 00/14] Makefile: Update migration warnings Simon Glass
2021-03-25 8:24 ` [PATCH v4 01/14] Makefile: Move non-DM migration messages to the top Simon Glass
2021-03-27 17:12 ` Tom Rini
2021-03-25 8:24 ` Simon Glass [this message]
2021-03-27 17:12 ` [PATCH v4 02/14] Makefile: Add common code to report deprecation Tom Rini
2021-03-25 8:24 ` [PATCH v4 03/14] Makefile: Use common code for MMC deprecation warning Simon Glass
2021-03-27 17:12 ` Tom Rini
2021-03-25 8:24 ` [PATCH v4 04/14] Makefile: Use common code for USB " Simon Glass
2021-03-27 17:12 ` Tom Rini
2021-03-25 8:24 ` [PATCH v4 05/14] Makefile: Use common code for MVSATA_IDE " Simon Glass
2021-03-27 17:12 ` Tom Rini
2021-03-25 8:24 ` [PATCH v4 06/14] Makefile: Use common code for LIBATA " Simon Glass
2021-03-27 17:12 ` Tom Rini
2021-03-25 8:24 ` [PATCH v4 07/14] Makefile: Use common code for PCI " Simon Glass
2021-03-27 17:12 ` Tom Rini
2021-03-25 8:24 ` [PATCH v4 08/14] Makefile: Use common code for DM_VIDEO " Simon Glass
2021-03-27 17:12 ` Tom Rini
2021-03-25 8:24 ` [PATCH v4 09/14] Makefile: Use common code for SPI_FLASH " Simon Glass
2021-03-27 17:12 ` Tom Rini
2021-03-25 8:24 ` [PATCH v4 10/14] Makefile: Use common code for WDT " Simon Glass
2021-03-27 17:12 ` Tom Rini
2021-03-25 8:24 ` [PATCH v4 11/14] Makefile: Use common code for DM_ETH " Simon Glass
2021-03-27 17:12 ` Tom Rini
2021-03-25 8:24 ` [PATCH v4 12/14] Makefile: Drop the old SPI flash migration message Simon Glass
2021-03-27 17:12 ` Tom Rini
2021-03-25 8:24 ` [PATCH v4 13/14] dm: i2c: Add a migration method for I2C Simon Glass
2021-03-27 17:13 ` Tom Rini
2021-03-25 8:24 ` [PATCH v4 14/14] dm: gpio: Add a migration message for GPIO Simon Glass
2021-03-27 15:58 ` Tom Rini
2021-03-27 16:05 ` Tom Rini
2021-03-31 6:46 ` [PATCH v4 00/14] Makefile: Update migration warnings Bin Meng
2021-03-31 16:39 ` Tom Rini
2021-03-31 22:19 ` Simon Glass
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=20210325082445.519028-3-sjg@chromium.org \
--to=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/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