Skip to content

Commit 2a130b7

Browse files
committed
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
2 parents c8d9f2c + 82cb443 commit 2a130b7

File tree

7 files changed

+66
-8
lines changed

7 files changed

+66
-8
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,7 @@ help:
16451645
echo '* dtbs - Build device tree blobs for enabled boards'; \
16461646
echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'; \
16471647
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'; \
16491649
echo ' dtbs_check - Validate device tree source files';\
16501650
echo '')
16511651

scripts/Makefile.dtbs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@ $(obj)/dtbs-list: $(dtb-y) FORCE
3434
# Assembly file to wrap dtb(o)
3535
# ---------------------------------------------------------------------------
3636

37+
builtin-dtb-section = $(if $(filter arch/$(SRCARCH)/boot/dts%, $(obj)),.dtb.init.rodata,.rodata)
38+
3739
# Generate an assembly file to wrap the output of the device tree compiler
3840
quiet_cmd_wrap_S_dtb = WRAP $@
3941
cmd_wrap_S_dtb = { \
4042
symbase=__$(patsubst .%,%,$(suffix $<))_$(subst -,_,$(notdir $*)); \
4143
echo '\#include <asm-generic/vmlinux.lds.h>'; \
42-
echo '.section .dtb.init.rodata,"a"'; \
44+
echo '.section $(builtin-dtb-section),"a"'; \
4345
echo '.balign STRUCT_ALIGNMENT'; \
4446
echo ".global $${symbase}_begin"; \
4547
echo "$${symbase}_begin:"; \

scripts/include/list.h

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,36 @@ static inline void list_del(struct list_head *entry)
127127
entry->prev = LIST_POISON2;
128128
}
129129

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+
130160
/**
131161
* list_move - delete from one list and add as another's head
132162
* @list: the entry to move
@@ -150,6 +180,26 @@ static inline void list_move_tail(struct list_head *list,
150180
list_add_tail(list, head);
151181
}
152182

183+
/**
184+
* list_is_first -- tests whether @list is the first entry in list @head
185+
* @list: the entry to test
186+
* @head: the head of the list
187+
*/
188+
static inline int list_is_first(const struct list_head *list, const struct list_head *head)
189+
{
190+
return list->prev == head;
191+
}
192+
193+
/**
194+
* list_is_last - tests whether @list is the last entry in list @head
195+
* @list: the entry to test
196+
* @head: the head of the list
197+
*/
198+
static inline int list_is_last(const struct list_head *list, const struct list_head *head)
199+
{
200+
return list->next == head;
201+
}
202+
153203
/**
154204
* list_is_head - tests whether @list is the list @head
155205
* @list: the entry to test

scripts/kconfig/expr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ static struct expr *expr_lookup(enum expr_type type, void *l, void *r)
4747
e->type = type;
4848
e->left._initdata = l;
4949
e->right._initdata = r;
50+
e->val_is_valid = false;
5051

5152
hash_add(expr_hashtable, &e->node, hash);
5253

scripts/kconfig/parser.y

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,14 @@ config_stmt: config_entry_start config_option_list
159159
yynerrs++;
160160
}
161161

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);
164170
}
165171

166172
printd(DEBUG_PARSE, "%s:%d:endconfig\n", cur_filename, cur_lineno);

scripts/kconfig/qconf.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ void ConfigInfoView::clicked(const QUrl &url)
11661166
{
11671167
QByteArray str = url.toEncoded();
11681168
const std::size_t count = str.size();
1169-
char *data = new char[count + 1];
1169+
char *data = new char[count + 2]; // '$' + '\0'
11701170
struct symbol **result;
11711171
struct menu *m = NULL;
11721172

@@ -1505,6 +1505,8 @@ ConfigMainWindow::ConfigMainWindow(void)
15051505
connect(helpText, &ConfigInfoView::menuSelected,
15061506
this, &ConfigMainWindow::setMenuLink);
15071507

1508+
conf_read(NULL);
1509+
15081510
QString listMode = configSettings->value("/listMode", "symbol").toString();
15091511
if (listMode == "single")
15101512
showSingleView();
@@ -1906,8 +1908,6 @@ int main(int ac, char** av)
19061908
configApp->connect(configApp, SIGNAL(lastWindowClosed()), SLOT(quit()));
19071909
configApp->connect(configApp, SIGNAL(aboutToQuit()), v, SLOT(saveSettings()));
19081910

1909-
conf_read(NULL);
1910-
19111911
v->show();
19121912
configApp->exec();
19131913

scripts/package/builddeb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ install_linux_image () {
7474

7575
mkdir -p "${pdir}/DEBIAN"
7676
cat <<-EOF > "${pdir}/DEBIAN/${script}"
77-
7877
#!/bin/sh
7978
8079
set -e

0 commit comments

Comments
 (0)