Skip to content

Commit c3d8f22

Browse files
committed
Merge tag 'kbuild-fixes-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild fixes from Masahiro Yamada: - move -Wsign-compare warning from W=2 to W=3 - fix the keyword _restrict to __restrict in genksyms - fix more bugs in qconf * tag 'kbuild-fixes-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kconfig: qconf: replace deprecated QString::sprintf() with QTextStream kconfig: qconf: remove redundant help in the info view kconfig: qconf: remove qInfo() to get back Qt4 support kconfig: qconf: remove unused colNr kconfig: qconf: fix the popup menu in the ConfigInfoView window kconfig: qconf: fix signal connection to invalid slots genksyms: keywords: Use __restrict not _restrict kbuild: remove redundant patterns in filter/filter-out extract-cert: add static to local data Makefile.extrawarn: Move sign-compare from W=2 to W=3
2 parents dd105d6 + 510bc3c commit c3d8f22

File tree

6 files changed

+86
-89
lines changed

6 files changed

+86
-89
lines changed

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,7 @@ no-dot-config-targets := $(clean-targets) \
265265
$(version_h) headers headers_% archheaders archscripts \
266266
%asm-generic kernelversion %src-pkg dt_binding_check \
267267
outputmakefile
268-
no-sync-config-targets := $(no-dot-config-targets) install %install \
269-
kernelrelease
268+
no-sync-config-targets := $(no-dot-config-targets) %install kernelrelease
270269
single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.s %.symtypes %/
271270

272271
config-build :=
@@ -292,7 +291,7 @@ ifneq ($(KBUILD_EXTMOD),)
292291
endif
293292

294293
ifeq ($(KBUILD_EXTMOD),)
295-
ifneq ($(filter config %config,$(MAKECMDGOALS)),)
294+
ifneq ($(filter %config,$(MAKECMDGOALS)),)
296295
config-build := 1
297296
ifneq ($(words $(MAKECMDGOALS)),1)
298297
mixed-build := 1

scripts/Makefile.extrawarn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ KBUILD_CFLAGS += -Wnested-externs
6666
KBUILD_CFLAGS += -Wshadow
6767
KBUILD_CFLAGS += $(call cc-option, -Wlogical-op)
6868
KBUILD_CFLAGS += -Wmissing-field-initializers
69-
KBUILD_CFLAGS += -Wsign-compare
7069
KBUILD_CFLAGS += -Wtype-limits
7170
KBUILD_CFLAGS += $(call cc-option, -Wmaybe-uninitialized)
7271
KBUILD_CFLAGS += $(call cc-option, -Wunused-macros)
@@ -87,6 +86,7 @@ KBUILD_CFLAGS += -Wpacked
8786
KBUILD_CFLAGS += -Wpadded
8887
KBUILD_CFLAGS += -Wpointer-arith
8988
KBUILD_CFLAGS += -Wredundant-decls
89+
KBUILD_CFLAGS += -Wsign-compare
9090
KBUILD_CFLAGS += -Wswitch-default
9191
KBUILD_CFLAGS += $(call cc-option, -Wpacked-bitfield-compat)
9292

scripts/extract-cert.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static void drain_openssl_errors(void)
7171
static const char *key_pass;
7272
static BIO *wb;
7373
static char *cert_dst;
74-
int kbuild_verbose;
74+
static int kbuild_verbose;
7575

7676
static void write_cert(X509 *x509)
7777
{

scripts/genksyms/keywords.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ static struct resword {
2525
{ "__int128_t", BUILTIN_INT_KEYW },
2626
{ "__uint128_t", BUILTIN_INT_KEYW },
2727

28-
// According to rth, c99 defines "_Bool", __restrict", __restrict__", "restrict". KAO
28+
// According to rth, c99 defines "_Bool", "__restrict", "__restrict__", "restrict". KAO
2929
{ "_Bool", BOOL_KEYW },
30-
{ "_restrict", RESTRICT_KEYW },
30+
{ "__restrict", RESTRICT_KEYW },
3131
{ "__restrict__", RESTRICT_KEYW },
3232
{ "restrict", RESTRICT_KEYW },
3333
{ "asm", ASM_KEYW },

scripts/kconfig/qconf.cc

Lines changed: 77 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
885885
connect(action, SIGNAL(toggled(bool)),
886886
parent(), SLOT(setShowName(bool)));
887887
connect(parent(), SIGNAL(showNameChanged(bool)),
888-
action, SLOT(setOn(bool)));
888+
action, SLOT(setChecked(bool)));
889889
action->setChecked(showName);
890890
headerPopup->addAction(action);
891891

@@ -894,7 +894,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
894894
connect(action, SIGNAL(toggled(bool)),
895895
parent(), SLOT(setShowRange(bool)));
896896
connect(parent(), SIGNAL(showRangeChanged(bool)),
897-
action, SLOT(setOn(bool)));
897+
action, SLOT(setChecked(bool)));
898898
action->setChecked(showRange);
899899
headerPopup->addAction(action);
900900

@@ -903,7 +903,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
903903
connect(action, SIGNAL(toggled(bool)),
904904
parent(), SLOT(setShowData(bool)));
905905
connect(parent(), SIGNAL(showDataChanged(bool)),
906-
action, SLOT(setOn(bool)));
906+
action, SLOT(setChecked(bool)));
907907
action->setChecked(showData);
908908
headerPopup->addAction(action);
909909
}
@@ -1012,6 +1012,16 @@ ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
10121012
configSettings->endGroup();
10131013
connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings()));
10141014
}
1015+
1016+
contextMenu = createStandardContextMenu();
1017+
QAction *action = new QAction("Show Debug Info", contextMenu);
1018+
1019+
action->setCheckable(true);
1020+
connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool)));
1021+
connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setChecked(bool)));
1022+
action->setChecked(showDebug());
1023+
contextMenu->addSeparator();
1024+
contextMenu->addAction(action);
10151025
}
10161026

10171027
void ConfigInfoView::saveSettings(void)
@@ -1066,111 +1076,114 @@ void ConfigInfoView::symbolInfo(void)
10661076
void ConfigInfoView::menuInfo(void)
10671077
{
10681078
struct symbol* sym;
1069-
QString head, debug, help;
1079+
QString info;
1080+
QTextStream stream(&info);
10701081

10711082
sym = _menu->sym;
10721083
if (sym) {
10731084
if (_menu->prompt) {
1074-
head += "<big><b>";
1075-
head += print_filter(_menu->prompt->text);
1076-
head += "</b></big>";
1085+
stream << "<big><b>";
1086+
stream << print_filter(_menu->prompt->text);
1087+
stream << "</b></big>";
10771088
if (sym->name) {
1078-
head += " (";
1089+
stream << " (";
10791090
if (showDebug())
1080-
head += QString().sprintf("<a href=\"s%s\">", sym->name);
1081-
head += print_filter(sym->name);
1091+
stream << "<a href=\"s" << sym->name << "\">";
1092+
stream << print_filter(sym->name);
10821093
if (showDebug())
1083-
head += "</a>";
1084-
head += ")";
1094+
stream << "</a>";
1095+
stream << ")";
10851096
}
10861097
} else if (sym->name) {
1087-
head += "<big><b>";
1098+
stream << "<big><b>";
10881099
if (showDebug())
1089-
head += QString().sprintf("<a href=\"s%s\">", sym->name);
1090-
head += print_filter(sym->name);
1100+
stream << "<a href=\"s" << sym->name << "\">";
1101+
stream << print_filter(sym->name);
10911102
if (showDebug())
1092-
head += "</a>";
1093-
head += "</b></big>";
1103+
stream << "</a>";
1104+
stream << "</b></big>";
10941105
}
1095-
head += "<br><br>";
1106+
stream << "<br><br>";
10961107

10971108
if (showDebug())
1098-
debug = debug_info(sym);
1109+
stream << debug_info(sym);
10991110

1100-
struct gstr help_gstr = str_new();
1101-
menu_get_ext_help(_menu, &help_gstr);
1102-
help = print_filter(str_get(&help_gstr));
1103-
str_free(&help_gstr);
11041111
} else if (_menu->prompt) {
1105-
head += "<big><b>";
1106-
head += print_filter(_menu->prompt->text);
1107-
head += "</b></big><br><br>";
1112+
stream << "<big><b>";
1113+
stream << print_filter(_menu->prompt->text);
1114+
stream << "</b></big><br><br>";
11081115
if (showDebug()) {
11091116
if (_menu->prompt->visible.expr) {
1110-
debug += "&nbsp;&nbsp;dep: ";
1111-
expr_print(_menu->prompt->visible.expr, expr_print_help, &debug, E_NONE);
1112-
debug += "<br><br>";
1117+
stream << "&nbsp;&nbsp;dep: ";
1118+
expr_print(_menu->prompt->visible.expr,
1119+
expr_print_help, &stream, E_NONE);
1120+
stream << "<br><br>";
11131121
}
11141122
}
11151123
}
11161124
if (showDebug())
1117-
debug += QString().sprintf("defined at %s:%d<br><br>", _menu->file->name, _menu->lineno);
1125+
stream << "defined at " << _menu->file->name << ":"
1126+
<< _menu->lineno << "<br><br>";
11181127

1119-
setText(head + debug + help);
1128+
setText(info);
11201129
}
11211130

11221131
QString ConfigInfoView::debug_info(struct symbol *sym)
11231132
{
11241133
QString debug;
1134+
QTextStream stream(&debug);
11251135

1126-
debug += "type: ";
1127-
debug += print_filter(sym_type_name(sym->type));
1136+
stream << "type: ";
1137+
stream << print_filter(sym_type_name(sym->type));
11281138
if (sym_is_choice(sym))
1129-
debug += " (choice)";
1139+
stream << " (choice)";
11301140
debug += "<br>";
11311141
if (sym->rev_dep.expr) {
1132-
debug += "reverse dep: ";
1133-
expr_print(sym->rev_dep.expr, expr_print_help, &debug, E_NONE);
1134-
debug += "<br>";
1142+
stream << "reverse dep: ";
1143+
expr_print(sym->rev_dep.expr, expr_print_help, &stream, E_NONE);
1144+
stream << "<br>";
11351145
}
11361146
for (struct property *prop = sym->prop; prop; prop = prop->next) {
11371147
switch (prop->type) {
11381148
case P_PROMPT:
11391149
case P_MENU:
1140-
debug += QString().sprintf("prompt: <a href=\"m%s\">", sym->name);
1141-
debug += print_filter(prop->text);
1142-
debug += "</a><br>";
1150+
stream << "prompt: <a href=\"m" << sym->name << "\">";
1151+
stream << print_filter(prop->text);
1152+
stream << "</a><br>";
11431153
break;
11441154
case P_DEFAULT:
11451155
case P_SELECT:
11461156
case P_RANGE:
11471157
case P_COMMENT:
11481158
case P_IMPLY:
11491159
case P_SYMBOL:
1150-
debug += prop_get_type_name(prop->type);
1151-
debug += ": ";
1152-
expr_print(prop->expr, expr_print_help, &debug, E_NONE);
1153-
debug += "<br>";
1160+
stream << prop_get_type_name(prop->type);
1161+
stream << ": ";
1162+
expr_print(prop->expr, expr_print_help,
1163+
&stream, E_NONE);
1164+
stream << "<br>";
11541165
break;
11551166
case P_CHOICE:
11561167
if (sym_is_choice(sym)) {
1157-
debug += "choice: ";
1158-
expr_print(prop->expr, expr_print_help, &debug, E_NONE);
1159-
debug += "<br>";
1168+
stream << "choice: ";
1169+
expr_print(prop->expr, expr_print_help,
1170+
&stream, E_NONE);
1171+
stream << "<br>";
11601172
}
11611173
break;
11621174
default:
1163-
debug += "unknown property: ";
1164-
debug += prop_get_type_name(prop->type);
1165-
debug += "<br>";
1175+
stream << "unknown property: ";
1176+
stream << prop_get_type_name(prop->type);
1177+
stream << "<br>";
11661178
}
11671179
if (prop->visible.expr) {
1168-
debug += "&nbsp;&nbsp;&nbsp;&nbsp;dep: ";
1169-
expr_print(prop->visible.expr, expr_print_help, &debug, E_NONE);
1170-
debug += "<br>";
1180+
stream << "&nbsp;&nbsp;&nbsp;&nbsp;dep: ";
1181+
expr_print(prop->visible.expr, expr_print_help,
1182+
&stream, E_NONE);
1183+
stream << "<br>";
11711184
}
11721185
}
1173-
debug += "<br>";
1186+
stream << "<br>";
11741187

11751188
return debug;
11761189
}
@@ -1208,15 +1221,15 @@ QString ConfigInfoView::print_filter(const QString &str)
12081221

12091222
void ConfigInfoView::expr_print_help(void *data, struct symbol *sym, const char *str)
12101223
{
1211-
QString* text = reinterpret_cast<QString*>(data);
1212-
QString str2 = print_filter(str);
1224+
QTextStream *stream = reinterpret_cast<QTextStream *>(data);
12131225

12141226
if (sym && sym->name && !(sym->flags & SYMBOL_CONST)) {
1215-
*text += QString().sprintf("<a href=\"s%s\">", sym->name);
1216-
*text += str2;
1217-
*text += "</a>";
1218-
} else
1219-
*text += str2;
1227+
*stream << "<a href=\"s" << sym->name << "\">";
1228+
*stream << print_filter(str);
1229+
*stream << "</a>";
1230+
} else {
1231+
*stream << print_filter(str);
1232+
}
12201233
}
12211234

12221235
void ConfigInfoView::clicked(const QUrl &url)
@@ -1228,7 +1241,6 @@ void ConfigInfoView::clicked(const QUrl &url)
12281241
struct menu *m = NULL;
12291242

12301243
if (count < 1) {
1231-
qInfo() << "Clicked link is empty";
12321244
delete[] data;
12331245
return;
12341246
}
@@ -1241,7 +1253,6 @@ void ConfigInfoView::clicked(const QUrl &url)
12411253
strcat(data, "$");
12421254
result = sym_re_search(data);
12431255
if (!result) {
1244-
qInfo() << "Clicked symbol is invalid:" << data;
12451256
delete[] data;
12461257
return;
12471258
}
@@ -1268,23 +1279,10 @@ void ConfigInfoView::clicked(const QUrl &url)
12681279
delete data;
12691280
}
12701281

1271-
QMenu* ConfigInfoView::createStandardContextMenu(const QPoint & pos)
1272-
{
1273-
QMenu* popup = Parent::createStandardContextMenu(pos);
1274-
QAction* action = new QAction("Show Debug Info", popup);
1275-
1276-
action->setCheckable(true);
1277-
connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool)));
1278-
connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool)));
1279-
action->setChecked(showDebug());
1280-
popup->addSeparator();
1281-
popup->addAction(action);
1282-
return popup;
1283-
}
1284-
1285-
void ConfigInfoView::contextMenuEvent(QContextMenuEvent *e)
1282+
void ConfigInfoView::contextMenuEvent(QContextMenuEvent *event)
12861283
{
1287-
Parent::contextMenuEvent(e);
1284+
contextMenu->popup(event->globalPos());
1285+
event->accept();
12881286
}
12891287

12901288
ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow *parent)

scripts/kconfig/qconf.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ConfigSettings : public QSettings {
3030
};
3131

3232
enum colIdx {
33-
promptColIdx, nameColIdx, noColIdx, modColIdx, yesColIdx, dataColIdx, colNr
33+
promptColIdx, nameColIdx, noColIdx, modColIdx, yesColIdx, dataColIdx
3434
};
3535
enum listMode {
3636
singleMode, menuMode, symbolMode, fullMode, listMode
@@ -215,6 +215,7 @@ public slots:
215215
class ConfigInfoView : public QTextBrowser {
216216
Q_OBJECT
217217
typedef class QTextBrowser Parent;
218+
QMenu *contextMenu;
218219
public:
219220
ConfigInfoView(QWidget* parent, const char *name = 0);
220221
bool showDebug(void) const { return _showDebug; }
@@ -235,8 +236,7 @@ public slots:
235236
QString debug_info(struct symbol *sym);
236237
static QString print_filter(const QString &str);
237238
static void expr_print_help(void *data, struct symbol *sym, const char *str);
238-
QMenu *createStandardContextMenu(const QPoint & pos);
239-
void contextMenuEvent(QContextMenuEvent *e);
239+
void contextMenuEvent(QContextMenuEvent *event);
240240

241241
struct symbol *sym;
242242
struct menu *_menu;

0 commit comments

Comments
 (0)