Skip to content

Commit

Permalink
checkkconfigsymbols.py: don't sort similar symbols
Browse files Browse the repository at this point in the history
Don't sort the list of string-similar Kconfig symbols alphabetically to
preserve the correct order of string similarity.

Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Valentin Rothberg authored and Greg Kroah-Hartman committed Jan 19, 2017
1 parent 39461ff commit 8e8e333
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/checkkconfigsymbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"""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>
#
# Licensed under the terms of the GNU GPL License version 2
Expand Down Expand Up @@ -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 = []
Expand All @@ -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():
Expand Down

0 comments on commit 8e8e333

Please sign in to comment.