diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2010-08-21 18:27:31 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-08-30 20:57:20 +0200 |
commit | 417e2d45fed238ed3f71e6c771bb84dbfc02c790 (patch) | |
tree | 56897fae86fbd2c883316be1546efaca53d42836 /commands/menu.c | |
parent | b11b88de64366210e6bb7a5e669bd6f4e770ccd7 (diff) | |
download | barebox-417e2d45fed238ed3f71e6c771bb84dbfc02c790.tar.gz barebox-417e2d45fed238ed3f71e6c771bb84dbfc02c790.tar.xz |
menu: use list_for_each_entry where appropriate
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/menu.c')
-rw-r--r-- | commands/menu.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/commands/menu.c b/commands/menu.c index 48834f3c0d..5efaa614d2 100644 --- a/commands/menu.c +++ b/commands/menu.c @@ -263,13 +263,10 @@ static int do_menu_show(struct cmd_menu *cm) static void print_entries(struct menu *m) { - struct list_head *pos; struct menu_entry *me; - list_for_each(pos, &(m->entries)) { - me = list_entry(pos, struct menu_entry, list); + list_for_each_entry(me, &m->entries, list) printf("%d: %s\n", me->num, me->display); - } } /* @@ -278,7 +275,6 @@ static void print_entries(struct menu *m) */ static int do_menu_list(struct cmd_menu *cm) { - struct list_head *pos; struct menu* m = NULL; struct menu* menus = menu_get_menus(); @@ -292,8 +288,7 @@ static int do_menu_list(struct cmd_menu *cm) } } - list_for_each(pos, &menus->list) { - m = list_entry(pos, struct menu, list); + list_for_each_entry(m, &menus->list, list) { printf("%s: %s\n", m->name, m->display? m->display : m->name); if (is_entry(cm)) print_entries(m); |