From b9cca2c57a7f3f51dc044030a2f1665e517edb51 Mon Sep 17 00:00:00 2001 From: Alper Nebi Yasak Date: Mon, 5 Oct 2020 09:57:30 +0300 Subject: checkpatch.pl: Make CONFIG_IS_ENABLED(CONFIG_*) an error CONFIG_IS_ENABLED() takes the kconfig name without the CONFIG_ prefix, e.g. CONFIG_IS_ENABLED(CLK) for CONFIG_CLK. Make including the prefix an error in checkpatch.pl so calls in the wrong format aren't accidentally reintroduced. Signed-off-by: Alper Nebi Yasak Reviewed-by: Simon Glass --- tools/patman/test_checkpatch.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools/patman/test_checkpatch.py') diff --git a/tools/patman/test_checkpatch.py b/tools/patman/test_checkpatch.py index 792196e6896..f71c70fb13a 100644 --- a/tools/patman/test_checkpatch.py +++ b/tools/patman/test_checkpatch.py @@ -405,6 +405,12 @@ index 0000000..2234c87 pm.add_line('include/myfile.h', '#include ') self.checkSingleMessage(pm, 'BARRED_INCLUDE_IN_HDR', 'error') + def testConfigIsEnabledConfig(self): + """Test for accidental CONFIG_IS_ENABLED(CONFIG_*) calls""" + pm = PatchMaker() + pm.add_line('common/main.c', 'if (CONFIG_IS_ENABLED(CONFIG_CLK))') + self.checkSingleMessage(pm, 'CONFIG_IS_ENABLED_CONFIG', 'error') + if __name__ == "__main__": unittest.main() -- cgit v1.2.3