summaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/mconf.c
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2023-07-16 13:55:08 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2023-07-25 00:59:32 +0900
commit356f0cb7efd9563112f18a2c8647ceb6d9f2ccef (patch)
tree73152ce3e57c5fae58a216b7cff8de72c827ecde /scripts/kconfig/mconf.c
parente14f1242a8be413846360b295102abd4c62848ad (diff)
downloadlinux-stable-356f0cb7efd9563112f18a2c8647ceb6d9f2ccef.tar.gz
linux-stable-356f0cb7efd9563112f18a2c8647ceb6d9f2ccef.tar.bz2
linux-stable-356f0cb7efd9563112f18a2c8647ceb6d9f2ccef.zip
kconfig: menuconfig: remove jump_key::index
You do not need to remember the index of each jump key because you can count it up after a key is pressed. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Jesse Taube <Mr.Bossman075@gmail.com>
Diffstat (limited to 'scripts/kconfig/mconf.c')
-rw-r--r--scripts/kconfig/mconf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 15b88921fe6a..eccc87a441e7 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -22,8 +22,6 @@
#include "lkc.h"
#include "lxdialog/dialog.h"
-#define JUMP_NB 9
-
static const char mconf_readme[] =
"Overview\n"
"--------\n"
@@ -402,18 +400,21 @@ static int handle_search_keys(int key, size_t start, size_t end, void *_data)
{
struct search_data *data = _data;
struct jump_key *pos;
+ int index = 0;
if (key < '1' || key > '9')
return 0;
list_for_each_entry(pos, data->head, entries) {
+ index = next_jump_key(index);
+
if (pos->offset < start)
continue;
if (pos->offset >= end)
break;
- if (key == '1' + (pos->index % JUMP_NB)) {
+ if (key == index) {
data->target = pos->target;
return 1;
}