From 8e8e333179d6ea50fd0491b138e71dc9d98378ba Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Wed, 18 Jan 2017 13:08:19 +0100 Subject: checkkconfigsymbols.py: don't sort similar symbols Don't sort the list of string-similar Kconfig symbols alphabetically to preserve the correct order of string similarity. Signed-off-by: Valentin Rothberg Signed-off-by: Greg Kroah-Hartman --- scripts/checkkconfigsymbols.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/checkkconfigsymbols.py b/scripts/checkkconfigsymbols.py index 3820f00b066a..f1d6b14081ac 100755 --- a/scripts/checkkconfigsymbols.py +++ b/scripts/checkkconfigsymbols.py @@ -2,7 +2,7 @@ """Find Kconfig symbols that are referenced but not defined.""" -# (c) 2014-2016 Valentin Rothberg +# (c) 2014-2017 Valentin Rothberg # (c) 2014 Stefan Hengelein # # Licensed under the terms of the GNU GPL License version 2 @@ -269,7 +269,7 @@ def find_sims(symbol, ignore, defined=[]): """Return a list of max. ten Kconfig symbols that are string-similar to @symbol.""" if defined: - return sorted(difflib.get_close_matches(symbol, set(defined), 10)) + return difflib.get_close_matches(symbol, set(defined), 10) pool = Pool(cpu_count(), init_worker) kfiles = [] @@ -284,7 +284,7 @@ def find_sims(symbol, ignore, defined=[]): for res in pool.map(parse_kconfig_files, arglist): defined.extend(res[0]) - return sorted(difflib.get_close_matches(symbol, set(defined), 10)) + return difflib.get_close_matches(symbol, set(defined), 10) def get_files(): -- cgit v1.2.3-59-g8ed1b From 3b28f4f2c2c7fcb6770cdfe5e8cd284ee1bc9783 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Thu, 2 Feb 2017 18:00:44 +0100 Subject: checkkconfigsymbols.py: support Kconfig's 'imply' statement Support the new imply statement in Kconfig. The imply statement has been added by commit 237e3ad0f195 ("Kconfig: Introduce the "imply" keyword") and is a weak version of a select, but the target symbol can still be turned off. Signed-off-by: Andreas Ziegler Signed-off-by: Valentin Rothberg Signed-off-by: Greg Kroah-Hartman --- scripts/checkkconfigsymbols.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/checkkconfigsymbols.py b/scripts/checkkconfigsymbols.py index f1d6b14081ac..8cd16c65d3c5 100755 --- a/scripts/checkkconfigsymbols.py +++ b/scripts/checkkconfigsymbols.py @@ -24,7 +24,7 @@ SYMBOL = r"(?:\w*[A-Z0-9]\w*){2,}" DEF = r"^\s*(?:menu){,1}config\s+(" + SYMBOL + r")\s*" EXPR = r"(?:" + OPERATORS + r"|\s|" + SYMBOL + r")+" DEFAULT = r"default\s+.*?(?:if\s.+){,1}" -STMT = r"^\s*(?:if|select|depends\s+on|(?:" + DEFAULT + r"))\s+" + EXPR +STMT = r"^\s*(?:if|select|imply|depends\s+on|(?:" + DEFAULT + r"))\s+" + EXPR SOURCE_SYMBOL = r"(?:\W|\b)+[D]{,1}CONFIG_(" + SYMBOL + r")" # regex objects -- cgit v1.2.3-59-g8ed1b