Merge tag 'kbuild-fixes-v5.8-4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

- clean the generated moc file for xconfig

- fix xconfig bugs, and revert some bad commits

* tag 'kbuild-fixes-v5.8-4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
kbuild: remove redundant FORCE definition in scripts/Makefile.modpost
kconfig: qconf: remove wrong ConfigList::firstChild()
Revert "kconfig: qconf: don't show goback button on splitMode"
Revert "kconfig: qconf: Change title for the item window"
kconfig: qconf: remove "goBack" debug message
kconfig: qconf: use delete[] instead of delete to free array
kconfig: qconf: compile moc object separately
kconfig: qconf: use if_changed for qconf.moc rule
modpost: explain why we can't use strsep

Changed files
+16 -30
scripts
-3
scripts/Makefile.modpost
··· 124 124 125 125 -include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd) 126 126 127 - PHONY += FORCE 128 - FORCE: 129 - 130 127 endif 131 128 132 129 .PHONY: $(PHONY)
+1 -1
scripts/kconfig/.gitignore
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 - *.moc 2 + /qconf-moc.cc 3 3 *conf-cfg 4 4 5 5 #
+8 -5
scripts/kconfig/Makefile
··· 181 181 182 182 # qconf: Used for the xconfig target based on Qt 183 183 hostprogs += qconf 184 - qconf-cxxobjs := qconf.o 184 + qconf-cxxobjs := qconf.o qconf-moc.o 185 185 qconf-objs := images.o $(common-objs) 186 186 187 187 HOSTLDLIBS_qconf = $(shell . $(obj)/qconf-cfg && echo $$libs) 188 188 HOSTCXXFLAGS_qconf.o = $(shell . $(obj)/qconf-cfg && echo $$cflags) 189 + HOSTCXXFLAGS_qconf-moc.o = $(shell . $(obj)/qconf-cfg && echo $$cflags) 189 190 190 - $(obj)/qconf.o: $(obj)/qconf-cfg $(obj)/qconf.moc 191 + $(obj)/qconf.o: $(obj)/qconf-cfg 191 192 192 193 quiet_cmd_moc = MOC $@ 193 - cmd_moc = $(shell . $(obj)/qconf-cfg && echo $$moc) -i $< -o $@ 194 + cmd_moc = $(shell . $(obj)/qconf-cfg && echo $$moc) $< -o $@ 194 195 195 - $(obj)/%.moc: $(src)/%.h $(obj)/qconf-cfg 196 - $(call cmd,moc) 196 + $(obj)/qconf-moc.cc: $(src)/qconf.h $(obj)/qconf-cfg FORCE 197 + $(call if_changed,moc) 198 + 199 + targets += qconf-moc.cc 197 200 198 201 # gconf: Used for the gconfig target based on GTK+ 199 202 hostprogs += gconf
+6 -17
scripts/kconfig/qconf.cc
··· 23 23 #include "lkc.h" 24 24 #include "qconf.h" 25 25 26 - #include "qconf.moc" 27 26 #include "images.h" 28 27 29 28 ··· 307 308 setVerticalScrollMode(ScrollPerPixel); 308 309 setHorizontalScrollMode(ScrollPerPixel); 309 310 310 - if (mode == symbolMode) 311 - setHeaderLabels(QStringList() << "Item" << "Name" << "N" << "M" << "Y" << "Value"); 312 - else 313 - setHeaderLabels(QStringList() << "Option" << "Name" << "N" << "M" << "Y" << "Value"); 311 + setHeaderLabels(QStringList() << "Option" << "Name" << "N" << "M" << "Y" << "Value"); 314 312 315 313 connect(this, SIGNAL(itemSelectionChanged(void)), 316 314 SLOT(updateSelection(void))); ··· 388 392 struct menu *menu; 389 393 enum prop_type type; 390 394 391 - if (mode == symbolMode) 392 - setHeaderLabels(QStringList() << "Item" << "Name" << "N" << "M" << "Y" << "Value"); 393 - else 394 - setHeaderLabels(QStringList() << "Option" << "Name" << "N" << "M" << "Y" << "Value"); 395 - 396 395 if (selectedItems().count() == 0) 397 396 return; 398 397 ··· 428 437 if (rootEntry != &rootmenu && (mode == singleMode || 429 438 (mode == symbolMode && rootEntry->parent != &rootmenu))) { 430 439 item = (ConfigItem *)topLevelItem(0); 431 - if (!item && mode != symbolMode) { 440 + if (!item) 432 441 item = new ConfigItem(this, 0, true); 433 - last = item; 434 - } 442 + last = item; 435 443 } 436 444 if ((mode == singleMode || (mode == symbolMode && !(rootEntry->flags & MENU_ROOT))) && 437 445 rootEntry->sym && rootEntry->prompt) { 438 - item = last ? last->nextSibling() : firstChild(); 446 + item = last ? last->nextSibling() : nullptr; 439 447 if (!item) 440 448 item = new ConfigItem(this, last, rootEntry, true); 441 449 else ··· 1229 1239 1230 1240 if (count < 1) { 1231 1241 qInfo() << "Clicked link is empty"; 1232 - delete data; 1242 + delete[] data; 1233 1243 return; 1234 1244 } 1235 1245 ··· 1242 1252 result = sym_re_search(data); 1243 1253 if (!result) { 1244 1254 qInfo() << "Clicked symbol is invalid:" << data; 1245 - delete data; 1255 + delete[] data; 1246 1256 return; 1247 1257 } 1248 1258 ··· 1725 1735 1726 1736 void ConfigMainWindow::goBack(void) 1727 1737 { 1728 - qInfo() << __FUNCTION__; 1729 1738 if (configList->rootEntry == &rootmenu) 1730 1739 return; 1731 1740
-4
scripts/kconfig/qconf.h
··· 92 92 { 93 93 return this; 94 94 } 95 - ConfigItem* firstChild() const 96 - { 97 - return (ConfigItem *)children().first(); 98 - } 99 95 void addColumn(colIdx idx) 100 96 { 101 97 showColumn(idx);
+1
scripts/mod/modpost.c
··· 144 144 if (!orig || *orig == '\0') 145 145 return NULL; 146 146 147 + /* don't use strsep here, it is not available everywhere */ 147 148 next = strchr(orig, '\n'); 148 149 if (next) 149 150 *next++ = '\0';