]> Git Repo - linux.git/commitdiff
Merge branch 'kbuild/rc-fixes' into kbuild/kconfig
authorMichal Marek <[email protected]>
Mon, 25 Feb 2013 20:50:05 +0000 (21:50 +0100)
committerMichal Marek <[email protected]>
Mon, 25 Feb 2013 20:51:57 +0000 (21:51 +0100)
There is one kconfig fix in the rc-fixes branch that I forgot to submit
for 3.8, so let's add it to the kconfig branch for 3.9-rc1.

1  2 
scripts/kconfig/mconf.c
scripts/kconfig/menu.c

diff --combined scripts/kconfig/mconf.c
index 680135effd9b8eaa494f4c9b7ae4b2bf8ce7e838,53975cf876083ecba455a7033222b2ccc3690686..566288a763709e1c6c6fb138ad2162a54a4b12c6
@@@ -280,7 -280,6 +280,7 @@@ static struct menu *current_menu
  static int child_count;
  static int single_menu_mode;
  static int show_all_options;
 +static int save_and_exit;
  
  static void conf(struct menu *menu, struct menu *active_menu);
  static void conf_choice(struct menu *menu);
@@@ -313,7 -312,7 +313,7 @@@ static void set_config_filename(const c
  
  
  struct search_data {
-       struct jk_head *head;
+       struct list_head *head;
        struct menu **targets;
        int *keys;
  };
@@@ -324,7 -323,7 +324,7 @@@ static void update_text(char *buf, size
        struct jump_key *pos;
        int k = 0;
  
-       CIRCLEQ_FOREACH(pos, data->head, entries) {
+       list_for_each_entry(pos, data->head, entries) {
                if (pos->offset >= start && pos->offset < end) {
                        char header[4];
  
@@@ -349,19 -348,15 +349,19 @@@ static void search_conf(void
  {
        struct symbol **sym_arr;
        struct gstr res;
 +      struct gstr title;
        char *dialog_input;
        int dres, vscroll = 0, hscroll = 0;
        bool again;
  
 +      title = str_new();
 +      str_printf( &title, _("Enter %s (sub)string to search for "
 +                            "(with or without \"%s\")"), CONFIG_, CONFIG_);
 +
  again:
        dialog_clear();
        dres = dialog_inputbox(_("Search Configuration Parameter"),
 -                            _("Enter " CONFIG_ " (sub)string to search for "
 -                              "(with or without \"" CONFIG_ "\")"),
 +                            str_get(&title),
                              10, 75, "");
        switch (dres) {
        case 0:
                show_helptext(_("Search Configuration"), search_help);
                goto again;
        default:
 +              str_free(&title);
                return;
        }
  
  
        sym_arr = sym_re_search(dialog_input);
        do {
-               struct jk_head head = CIRCLEQ_HEAD_INITIALIZER(head);
+               LIST_HEAD(head);
                struct menu *targets[JUMP_NB];
                int keys[JUMP_NB + 1], i;
                struct search_data data = {
                str_free(&res);
        } while (again);
        free(sym_arr);
 +      str_free(&title);
  }
  
  static void build_conf(struct menu *menu)
@@@ -599,6 -592,14 +599,6 @@@ static void conf(struct menu *menu, str
                build_conf(menu);
                if (!child_count)
                        break;
 -              if (menu == &rootmenu) {
 -                      item_make("--- ");
 -                      item_set_tag(':');
 -                      item_make(_("    Load an Alternate Configuration File"));
 -                      item_set_tag('L');
 -                      item_make(_("    Save an Alternate Configuration File"));
 -                      item_set_tag('S');
 -              }
                dialog_clear();
                res = dialog_menu(prompt ? _(prompt) : _("Main Menu"),
                                  _(menu_instructions),
                        case 's':
                                conf_string(submenu);
                                break;
 -                      case 'L':
 -                              conf_load();
 -                              break;
 -                      case 'S':
 -                              conf_save();
 -                              break;
                        }
                        break;
                case 2:
                                show_helptext(_("README"), _(mconf_readme));
                        break;
                case 3:
 +                      conf_save();
 +                      break;
 +              case 4:
 +                      conf_load();
 +                      break;
 +              case 5:
                        if (item_is_tag('t')) {
                                if (sym_set_tristate_value(sym, yes))
                                        break;
                                        show_textbox(NULL, setmod_text, 6, 74);
                        }
                        break;
 -              case 4:
 +              case 6:
                        if (item_is_tag('t'))
                                sym_set_tristate_value(sym, no);
                        break;
 -              case 5:
 +              case 7:
                        if (item_is_tag('t'))
                                sym_set_tristate_value(sym, mod);
                        break;
 -              case 6:
 +              case 8:
                        if (item_is_tag('t'))
                                sym_toggle_tristate_value(sym);
                        else if (item_is_tag('m'))
                                conf(submenu, NULL);
                        break;
 -              case 7:
 +              case 9:
                        search_conf();
                        break;
 -              case 8:
 +              case 10:
                        show_all_options = !show_all_options;
                        break;
                }
@@@ -701,17 -702,6 +701,17 @@@ static void show_helptext(const char *t
        show_textbox(title, text, 0, 0);
  }
  
 +static void conf_message_callback(const char *fmt, va_list ap)
 +{
 +      char buf[PATH_MAX+1];
 +
 +      vsnprintf(buf, sizeof(buf), fmt, ap);
 +      if (save_and_exit)
 +              printf("%s", buf);
 +      else
 +              show_textbox(NULL, buf, 6, 60);
 +}
 +
  static void show_help(struct menu *menu)
  {
        struct gstr help = str_new();
@@@ -880,7 -870,6 +880,7 @@@ static int handle_exit(void
  {
        int res;
  
 +      save_and_exit = 1;
        dialog_clear();
        if (conf_get_changed())
                res = dialog_yesno(NULL,
@@@ -952,7 -941,6 +952,7 @@@ int main(int ac, char **av
        }
  
        set_config_filename(conf_get_configname());
 +      conf_set_message_callback(conf_message_callback);
        do {
                conf(&rootmenu, NULL);
                res = handle_exit();
diff --combined scripts/kconfig/menu.c
index 84a2ba2077aada5b12a296314c03ed6ea225e113,e98a05c8e50882d3b2833a2f4d05761dcffd22d3..f3bffa309333061ed5d852e7c00132107017add5
@@@ -48,7 -48,7 +48,7 @@@ void menu_add_entry(struct symbol *sym
  {
        struct menu *menu;
  
 -      menu = malloc(sizeof(*menu));
 +      menu = xmalloc(sizeof(*menu));
        memset(menu, 0, sizeof(*menu));
        menu->sym = sym;
        menu->parent = current_menu;
@@@ -508,7 -508,7 +508,7 @@@ const char *menu_get_help(struct menu *
  }
  
  static void get_prompt_str(struct gstr *r, struct property *prop,
-                          struct jk_head *head)
+                          struct list_head *head)
  {
        int i, j;
        struct menu *submenu[8], *menu, *location = NULL;
                        location = menu;
        }
        if (head && location) {
 -              jump = malloc(sizeof(struct jump_key));
 +              jump = xmalloc(sizeof(struct jump_key));
  
                if (menu_is_visible(prop->menu)) {
                        /*
                } else
                        jump->target = location;
  
-               if (CIRCLEQ_EMPTY(head))
+               if (list_empty(head))
                        jump->index = 0;
                else
-                       jump->index = CIRCLEQ_LAST(head)->index + 1;
+                       jump->index = list_entry(head->prev, struct jump_key,
+                                                entries)->index + 1;
  
-               CIRCLEQ_INSERT_TAIL(head, jump, entries);
+               list_add_tail(&jump->entries, head);
        }
  
        if (i > 0) {
  /*
   * head is optional and may be NULL
   */
- void get_symbol_str(struct gstr *r, struct symbol *sym, struct jk_head *head)
+ void get_symbol_str(struct gstr *r, struct symbol *sym,
+                   struct list_head *head)
  {
        bool hit;
        struct property *prop;
        str_append(r, "\n\n");
  }
  
- struct gstr get_relations_str(struct symbol **sym_arr, struct jk_head *head)
+ struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head)
  {
        struct symbol *sym;
        struct gstr res = str_new();
This page took 0.070346 seconds and 4 git commands to generate.