Commit 8e8e3331 authored by Valentin Rothberg's avatar Valentin Rothberg Committed by Greg Kroah-Hartman

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: default avatarValentin Rothberg <valentinrothberg@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 39461ffd
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"""Find Kconfig symbols that are referenced but not defined.""" """Find Kconfig symbols that are referenced but not defined."""
# (c) 2014-2016 Valentin Rothberg <valentinrothberg@gmail.com> # (c) 2014-2017 Valentin Rothberg <valentinrothberg@gmail.com>
# (c) 2014 Stefan Hengelein <stefan.hengelein@fau.de> # (c) 2014 Stefan Hengelein <stefan.hengelein@fau.de>
# #
# Licensed under the terms of the GNU GPL License version 2 # Licensed under the terms of the GNU GPL License version 2
...@@ -269,7 +269,7 @@ def find_sims(symbol, ignore, defined=[]): ...@@ -269,7 +269,7 @@ def find_sims(symbol, ignore, defined=[]):
"""Return a list of max. ten Kconfig symbols that are string-similar to """Return a list of max. ten Kconfig symbols that are string-similar to
@symbol.""" @symbol."""
if defined: 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) pool = Pool(cpu_count(), init_worker)
kfiles = [] kfiles = []
...@@ -284,7 +284,7 @@ def find_sims(symbol, ignore, defined=[]): ...@@ -284,7 +284,7 @@ def find_sims(symbol, ignore, defined=[]):
for res in pool.map(parse_kconfig_files, arglist): for res in pool.map(parse_kconfig_files, arglist):
defined.extend(res[0]) 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(): def get_files():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment