From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [PATCHv2] checkpatch.pl: Add check for defining CONFIG_CMD_xxx via config files
Date: Tue, 26 May 2020 14:29:02 -0400 [thread overview]
Message-ID: <20200526182902.28417-1-trini@konsulko.com> (raw)
In-Reply-To: <20200522223240.187032-1-sjg@chromium.org>
All of our cmds have a Kconfig entry. Making enabling a CMD via the
config file an error to checkpatch.pl.
Signed-off-by: Tom Rini <trini@konsulko.com>
---
Changes in v2:
- Rebase on Simon's update that adds a u-boot section
- Catch undef as well
- Have a more generic message
---
scripts/checkpatch.pl | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 33ec4e2bfd44..cabb072a0de9 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2265,6 +2265,12 @@ sub u_boot_line {
WARN("PREFER_IF",
"Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef' where possible\n" . $herecurr);
}
+
+ # use defconfig to manage CONFIG_CMD options
+ if ($line =~ /\+\s*#\s*(define|undef)\s+(CONFIG_CMD\w*)\b/) {
+ ERROR("DEFINE_CONFIG_CMD",
+ "All commands are managed by Kconfig\n" . $herecurr);
+ }
}
sub process {
--
2.17.1
next prev parent reply other threads:[~2020-05-26 18:29 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-22 22:32 [PATCH 0/6] checkpatch.pl: Add features to help improve U-Boot code Simon Glass
2020-05-22 22:32 ` [PATCH 1/6] checkpatch.pl: Update to v5.7-rc6 Simon Glass
2020-06-04 23:39 ` Tom Rini
2020-05-22 22:32 ` [PATCH 2/6] checkpatch.pl: Add a U-Boot option Simon Glass
2020-06-04 23:39 ` Tom Rini
2020-05-22 22:32 ` [PATCH 3/6] checkpatch.pl: Add a check for tests needed for uclasses Simon Glass
2020-06-04 23:39 ` Tom Rini
2020-05-22 22:32 ` [PATCH 4/6] checkpatch.pl: Warn if the flattree API is used Simon Glass
2020-06-04 23:39 ` Tom Rini
2020-05-22 22:32 ` [PATCH 5/6] checkpatch.pl: Request a test when a new command is added Simon Glass
2020-06-04 23:39 ` Tom Rini
2020-05-22 22:32 ` [PATCH 6/6] checkpatch.pl: Request if() instead #ifdef Simon Glass
2020-06-04 23:39 ` Tom Rini
2020-06-15 2:58 ` AKASHI Takahiro
2020-06-15 3:58 ` Simon Glass
2020-06-15 14:34 ` Tom Rini
2020-06-16 0:34 ` AKASHI Takahiro
2020-06-16 1:21 ` Tom Rini
2020-06-16 2:15 ` Simon Glass
2020-05-24 18:23 ` [PATCH 0/6] checkpatch.pl: Add features to help improve U-Boot code Tom Rini
2020-05-26 18:29 ` Tom Rini [this message]
2020-06-04 23:39 ` [PATCHv2] checkpatch.pl: Add check for defining CONFIG_CMD_xxx via config files Tom Rini
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=20200526182902.28417-1-trini@konsulko.com \
--to=trini@konsulko.com \
--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