Merge tag 'kbuild-fixes-v6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

- Move non-boot built-in DTBs to the .rodata section

- Fix Kconfig bugs

- Fix maint scripts in the linux-image Debian package

- Import some list macros to scripts/include/

* tag 'kbuild-fixes-v6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
kbuild: deb-pkg: Remove blank first line from maint scripts
kbuild: fix a typo dt_binding_schema -> dt_binding_schemas
scripts: import more list macros
kconfig: qconf: fix buffer overflow in debug links
kconfig: qconf: move conf_read() before drawing tree pain
kconfig: clear expr::val_is_valid when allocated
kconfig: fix infinite loop in sym_calc_choice()
kbuild: move non-boot built-in DTBs to .rodata section

Changed files
+66 -8
scripts
+1 -1
Makefile
··· 1645 1645 echo '* dtbs - Build device tree blobs for enabled boards'; \ 1646 1646 echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'; \ 1647 1647 echo ' dt_binding_check - Validate device tree binding documents and examples'; \ 1648 - echo ' dt_binding_schema - Build processed device tree binding schemas'; \ 1648 + echo ' dt_binding_schemas - Build processed device tree binding schemas'; \ 1649 1649 echo ' dtbs_check - Validate device tree source files';\ 1650 1650 echo '') 1651 1651
+3 -1
scripts/Makefile.dtbs
··· 34 34 # Assembly file to wrap dtb(o) 35 35 # --------------------------------------------------------------------------- 36 36 37 + builtin-dtb-section = $(if $(filter arch/$(SRCARCH)/boot/dts%, $(obj)),.dtb.init.rodata,.rodata) 38 + 37 39 # Generate an assembly file to wrap the output of the device tree compiler 38 40 quiet_cmd_wrap_S_dtb = WRAP $@ 39 41 cmd_wrap_S_dtb = { \ 40 42 symbase=__$(patsubst .%,%,$(suffix $<))_$(subst -,_,$(notdir $*)); \ 41 43 echo '\#include <asm-generic/vmlinux.lds.h>'; \ 42 - echo '.section .dtb.init.rodata,"a"'; \ 44 + echo '.section $(builtin-dtb-section),"a"'; \ 43 45 echo '.balign STRUCT_ALIGNMENT'; \ 44 46 echo ".global $${symbase}_begin"; \ 45 47 echo "$${symbase}_begin:"; \
+50
scripts/include/list.h
··· 128 128 } 129 129 130 130 /** 131 + * list_replace - replace old entry by new one 132 + * @old : the element to be replaced 133 + * @new : the new element to insert 134 + * 135 + * If @old was empty, it will be overwritten. 136 + */ 137 + static inline void list_replace(struct list_head *old, 138 + struct list_head *new) 139 + { 140 + new->next = old->next; 141 + new->next->prev = new; 142 + new->prev = old->prev; 143 + new->prev->next = new; 144 + } 145 + 146 + /** 147 + * list_replace_init - replace old entry by new one and initialize the old one 148 + * @old : the element to be replaced 149 + * @new : the new element to insert 150 + * 151 + * If @old was empty, it will be overwritten. 152 + */ 153 + static inline void list_replace_init(struct list_head *old, 154 + struct list_head *new) 155 + { 156 + list_replace(old, new); 157 + INIT_LIST_HEAD(old); 158 + } 159 + 160 + /** 131 161 * list_move - delete from one list and add as another's head 132 162 * @list: the entry to move 133 163 * @head: the head that will precede our entry ··· 178 148 { 179 149 __list_del_entry(list); 180 150 list_add_tail(list, head); 151 + } 152 + 153 + /** 154 + * list_is_first -- tests whether @list is the first entry in list @head 155 + * @list: the entry to test 156 + * @head: the head of the list 157 + */ 158 + static inline int list_is_first(const struct list_head *list, const struct list_head *head) 159 + { 160 + return list->prev == head; 161 + } 162 + 163 + /** 164 + * list_is_last - tests whether @list is the last entry in list @head 165 + * @list: the entry to test 166 + * @head: the head of the list 167 + */ 168 + static inline int list_is_last(const struct list_head *list, const struct list_head *head) 169 + { 170 + return list->next == head; 181 171 } 182 172 183 173 /**
+1
scripts/kconfig/expr.c
··· 47 47 e->type = type; 48 48 e->left._initdata = l; 49 49 e->right._initdata = r; 50 + e->val_is_valid = false; 50 51 51 52 hash_add(expr_hashtable, &e->node, hash); 52 53
+8 -2
scripts/kconfig/parser.y
··· 159 159 yynerrs++; 160 160 } 161 161 162 - list_add_tail(&current_entry->sym->choice_link, 163 - &current_choice->choice_members); 162 + /* 163 + * If the same symbol appears twice in a choice block, the list 164 + * node would be added twice, leading to a broken linked list. 165 + * list_empty() ensures that this symbol has not yet added. 166 + */ 167 + if (list_empty(&current_entry->sym->choice_link)) 168 + list_add_tail(&current_entry->sym->choice_link, 169 + &current_choice->choice_members); 164 170 } 165 171 166 172 printd(DEBUG_PARSE, "%s:%d:endconfig\n", cur_filename, cur_lineno);
+3 -3
scripts/kconfig/qconf.cc
··· 1166 1166 { 1167 1167 QByteArray str = url.toEncoded(); 1168 1168 const std::size_t count = str.size(); 1169 - char *data = new char[count + 1]; 1169 + char *data = new char[count + 2]; // '$' + '\0' 1170 1170 struct symbol **result; 1171 1171 struct menu *m = NULL; 1172 1172 ··· 1504 1504 this, &ConfigMainWindow::listFocusChanged); 1505 1505 connect(helpText, &ConfigInfoView::menuSelected, 1506 1506 this, &ConfigMainWindow::setMenuLink); 1507 + 1508 + conf_read(NULL); 1507 1509 1508 1510 QString listMode = configSettings->value("/listMode", "symbol").toString(); 1509 1511 if (listMode == "single") ··· 1907 1905 //zconfdump(stdout); 1908 1906 configApp->connect(configApp, SIGNAL(lastWindowClosed()), SLOT(quit())); 1909 1907 configApp->connect(configApp, SIGNAL(aboutToQuit()), v, SLOT(saveSettings())); 1910 - 1911 - conf_read(NULL); 1912 1908 1913 1909 v->show(); 1914 1910 configApp->exec();
-1
scripts/package/builddeb
··· 74 74 75 75 mkdir -p "${pdir}/DEBIAN" 76 76 cat <<-EOF > "${pdir}/DEBIAN/${script}" 77 - 78 77 #!/bin/sh 79 78 80 79 set -e