Skip to content

Commit

Permalink
Merge tag 'kbuild-fixes-v5.9' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/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
  • Loading branch information
torvalds committed Aug 22, 2020
2 parents dd105d6 + 510bc3c commit c3d8f22
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 89 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@ no-dot-config-targets := $(clean-targets) \
$(version_h) headers headers_% archheaders archscripts \
%asm-generic kernelversion %src-pkg dt_binding_check \
outputmakefile
no-sync-config-targets := $(no-dot-config-targets) install %install \
kernelrelease
no-sync-config-targets := $(no-dot-config-targets) %install kernelrelease
single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.s %.symtypes %/

config-build :=
Expand All @@ -292,7 +291,7 @@ ifneq ($(KBUILD_EXTMOD),)
endif

ifeq ($(KBUILD_EXTMOD),)
ifneq ($(filter config %config,$(MAKECMDGOALS)),)
ifneq ($(filter %config,$(MAKECMDGOALS)),)
config-build := 1
ifneq ($(words $(MAKECMDGOALS)),1)
mixed-build := 1
Expand Down
2 changes: 1 addition & 1 deletion scripts/Makefile.extrawarn
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ KBUILD_CFLAGS += -Wnested-externs
KBUILD_CFLAGS += -Wshadow
KBUILD_CFLAGS += $(call cc-option, -Wlogical-op)
KBUILD_CFLAGS += -Wmissing-field-initializers
KBUILD_CFLAGS += -Wsign-compare
KBUILD_CFLAGS += -Wtype-limits
KBUILD_CFLAGS += $(call cc-option, -Wmaybe-uninitialized)
KBUILD_CFLAGS += $(call cc-option, -Wunused-macros)
Expand All @@ -87,6 +86,7 @@ KBUILD_CFLAGS += -Wpacked
KBUILD_CFLAGS += -Wpadded
KBUILD_CFLAGS += -Wpointer-arith
KBUILD_CFLAGS += -Wredundant-decls
KBUILD_CFLAGS += -Wsign-compare
KBUILD_CFLAGS += -Wswitch-default
KBUILD_CFLAGS += $(call cc-option, -Wpacked-bitfield-compat)

Expand Down
2 changes: 1 addition & 1 deletion scripts/extract-cert.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static void drain_openssl_errors(void)
static const char *key_pass;
static BIO *wb;
static char *cert_dst;
int kbuild_verbose;
static int kbuild_verbose;

static void write_cert(X509 *x509)
{
Expand Down
4 changes: 2 additions & 2 deletions scripts/genksyms/keywords.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ static struct resword {
{ "__int128_t", BUILTIN_INT_KEYW },
{ "__uint128_t", BUILTIN_INT_KEYW },

// According to rth, c99 defines "_Bool", __restrict", __restrict__", "restrict". KAO
// According to rth, c99 defines "_Bool", "__restrict", "__restrict__", "restrict". KAO
{ "_Bool", BOOL_KEYW },
{ "_restrict", RESTRICT_KEYW },
{ "__restrict", RESTRICT_KEYW },
{ "__restrict__", RESTRICT_KEYW },
{ "restrict", RESTRICT_KEYW },
{ "asm", ASM_KEYW },
Expand Down
156 changes: 77 additions & 79 deletions scripts/kconfig/qconf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
connect(action, SIGNAL(toggled(bool)),
parent(), SLOT(setShowName(bool)));
connect(parent(), SIGNAL(showNameChanged(bool)),
action, SLOT(setOn(bool)));
action, SLOT(setChecked(bool)));
action->setChecked(showName);
headerPopup->addAction(action);

Expand All @@ -894,7 +894,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
connect(action, SIGNAL(toggled(bool)),
parent(), SLOT(setShowRange(bool)));
connect(parent(), SIGNAL(showRangeChanged(bool)),
action, SLOT(setOn(bool)));
action, SLOT(setChecked(bool)));
action->setChecked(showRange);
headerPopup->addAction(action);

Expand All @@ -903,7 +903,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
connect(action, SIGNAL(toggled(bool)),
parent(), SLOT(setShowData(bool)));
connect(parent(), SIGNAL(showDataChanged(bool)),
action, SLOT(setOn(bool)));
action, SLOT(setChecked(bool)));
action->setChecked(showData);
headerPopup->addAction(action);
}
Expand Down Expand Up @@ -1012,6 +1012,16 @@ ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
configSettings->endGroup();
connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings()));
}

contextMenu = createStandardContextMenu();
QAction *action = new QAction("Show Debug Info", contextMenu);

action->setCheckable(true);
connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool)));
connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setChecked(bool)));
action->setChecked(showDebug());
contextMenu->addSeparator();
contextMenu->addAction(action);
}

void ConfigInfoView::saveSettings(void)
Expand Down Expand Up @@ -1066,111 +1076,114 @@ void ConfigInfoView::symbolInfo(void)
void ConfigInfoView::menuInfo(void)
{
struct symbol* sym;
QString head, debug, help;
QString info;
QTextStream stream(&info);

sym = _menu->sym;
if (sym) {
if (_menu->prompt) {
head += "<big><b>";
head += print_filter(_menu->prompt->text);
head += "</b></big>";
stream << "<big><b>";
stream << print_filter(_menu->prompt->text);
stream << "</b></big>";
if (sym->name) {
head += " (";
stream << " (";
if (showDebug())
head += QString().sprintf("<a href=\"s%s\">", sym->name);
head += print_filter(sym->name);
stream << "<a href=\"s" << sym->name << "\">";
stream << print_filter(sym->name);
if (showDebug())
head += "</a>";
head += ")";
stream << "</a>";
stream << ")";
}
} else if (sym->name) {
head += "<big><b>";
stream << "<big><b>";
if (showDebug())
head += QString().sprintf("<a href=\"s%s\">", sym->name);
head += print_filter(sym->name);
stream << "<a href=\"s" << sym->name << "\">";
stream << print_filter(sym->name);
if (showDebug())
head += "</a>";
head += "</b></big>";
stream << "</a>";
stream << "</b></big>";
}
head += "<br><br>";
stream << "<br><br>";

if (showDebug())
debug = debug_info(sym);
stream << debug_info(sym);

struct gstr help_gstr = str_new();
menu_get_ext_help(_menu, &help_gstr);
help = print_filter(str_get(&help_gstr));
str_free(&help_gstr);
} else if (_menu->prompt) {
head += "<big><b>";
head += print_filter(_menu->prompt->text);
head += "</b></big><br><br>";
stream << "<big><b>";
stream << print_filter(_menu->prompt->text);
stream << "</b></big><br><br>";
if (showDebug()) {
if (_menu->prompt->visible.expr) {
debug += "&nbsp;&nbsp;dep: ";
expr_print(_menu->prompt->visible.expr, expr_print_help, &debug, E_NONE);
debug += "<br><br>";
stream << "&nbsp;&nbsp;dep: ";
expr_print(_menu->prompt->visible.expr,
expr_print_help, &stream, E_NONE);
stream << "<br><br>";
}
}
}
if (showDebug())
debug += QString().sprintf("defined at %s:%d<br><br>", _menu->file->name, _menu->lineno);
stream << "defined at " << _menu->file->name << ":"
<< _menu->lineno << "<br><br>";

setText(head + debug + help);
setText(info);
}

QString ConfigInfoView::debug_info(struct symbol *sym)
{
QString debug;
QTextStream stream(&debug);

debug += "type: ";
debug += print_filter(sym_type_name(sym->type));
stream << "type: ";
stream << print_filter(sym_type_name(sym->type));
if (sym_is_choice(sym))
debug += " (choice)";
stream << " (choice)";
debug += "<br>";
if (sym->rev_dep.expr) {
debug += "reverse dep: ";
expr_print(sym->rev_dep.expr, expr_print_help, &debug, E_NONE);
debug += "<br>";
stream << "reverse dep: ";
expr_print(sym->rev_dep.expr, expr_print_help, &stream, E_NONE);
stream << "<br>";
}
for (struct property *prop = sym->prop; prop; prop = prop->next) {
switch (prop->type) {
case P_PROMPT:
case P_MENU:
debug += QString().sprintf("prompt: <a href=\"m%s\">", sym->name);
debug += print_filter(prop->text);
debug += "</a><br>";
stream << "prompt: <a href=\"m" << sym->name << "\">";
stream << print_filter(prop->text);
stream << "</a><br>";
break;
case P_DEFAULT:
case P_SELECT:
case P_RANGE:
case P_COMMENT:
case P_IMPLY:
case P_SYMBOL:
debug += prop_get_type_name(prop->type);
debug += ": ";
expr_print(prop->expr, expr_print_help, &debug, E_NONE);
debug += "<br>";
stream << prop_get_type_name(prop->type);
stream << ": ";
expr_print(prop->expr, expr_print_help,
&stream, E_NONE);
stream << "<br>";
break;
case P_CHOICE:
if (sym_is_choice(sym)) {
debug += "choice: ";
expr_print(prop->expr, expr_print_help, &debug, E_NONE);
debug += "<br>";
stream << "choice: ";
expr_print(prop->expr, expr_print_help,
&stream, E_NONE);
stream << "<br>";
}
break;
default:
debug += "unknown property: ";
debug += prop_get_type_name(prop->type);
debug += "<br>";
stream << "unknown property: ";
stream << prop_get_type_name(prop->type);
stream << "<br>";
}
if (prop->visible.expr) {
debug += "&nbsp;&nbsp;&nbsp;&nbsp;dep: ";
expr_print(prop->visible.expr, expr_print_help, &debug, E_NONE);
debug += "<br>";
stream << "&nbsp;&nbsp;&nbsp;&nbsp;dep: ";
expr_print(prop->visible.expr, expr_print_help,
&stream, E_NONE);
stream << "<br>";
}
}
debug += "<br>";
stream << "<br>";

return debug;
}
Expand Down Expand Up @@ -1208,15 +1221,15 @@ QString ConfigInfoView::print_filter(const QString &str)

void ConfigInfoView::expr_print_help(void *data, struct symbol *sym, const char *str)
{
QString* text = reinterpret_cast<QString*>(data);
QString str2 = print_filter(str);
QTextStream *stream = reinterpret_cast<QTextStream *>(data);

if (sym && sym->name && !(sym->flags & SYMBOL_CONST)) {
*text += QString().sprintf("<a href=\"s%s\">", sym->name);
*text += str2;
*text += "</a>";
} else
*text += str2;
*stream << "<a href=\"s" << sym->name << "\">";
*stream << print_filter(str);
*stream << "</a>";
} else {
*stream << print_filter(str);
}
}

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

if (count < 1) {
qInfo() << "Clicked link is empty";
delete[] data;
return;
}
Expand All @@ -1241,7 +1253,6 @@ void ConfigInfoView::clicked(const QUrl &url)
strcat(data, "$");
result = sym_re_search(data);
if (!result) {
qInfo() << "Clicked symbol is invalid:" << data;
delete[] data;
return;
}
Expand All @@ -1268,23 +1279,10 @@ void ConfigInfoView::clicked(const QUrl &url)
delete data;
}

QMenu* ConfigInfoView::createStandardContextMenu(const QPoint & pos)
{
QMenu* popup = Parent::createStandardContextMenu(pos);
QAction* action = new QAction("Show Debug Info", popup);

action->setCheckable(true);
connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool)));
connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool)));
action->setChecked(showDebug());
popup->addSeparator();
popup->addAction(action);
return popup;
}

void ConfigInfoView::contextMenuEvent(QContextMenuEvent *e)
void ConfigInfoView::contextMenuEvent(QContextMenuEvent *event)
{
Parent::contextMenuEvent(e);
contextMenu->popup(event->globalPos());
event->accept();
}

ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow *parent)
Expand Down
6 changes: 3 additions & 3 deletions scripts/kconfig/qconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ConfigSettings : public QSettings {
};

enum colIdx {
promptColIdx, nameColIdx, noColIdx, modColIdx, yesColIdx, dataColIdx, colNr
promptColIdx, nameColIdx, noColIdx, modColIdx, yesColIdx, dataColIdx
};
enum listMode {
singleMode, menuMode, symbolMode, fullMode, listMode
Expand Down Expand Up @@ -215,6 +215,7 @@ public slots:
class ConfigInfoView : public QTextBrowser {
Q_OBJECT
typedef class QTextBrowser Parent;
QMenu *contextMenu;
public:
ConfigInfoView(QWidget* parent, const char *name = 0);
bool showDebug(void) const { return _showDebug; }
Expand All @@ -235,8 +236,7 @@ public slots:
QString debug_info(struct symbol *sym);
static QString print_filter(const QString &str);
static void expr_print_help(void *data, struct symbol *sym, const char *str);
QMenu *createStandardContextMenu(const QPoint & pos);
void contextMenuEvent(QContextMenuEvent *e);
void contextMenuEvent(QContextMenuEvent *event);

struct symbol *sym;
struct menu *_menu;
Expand Down

0 comments on commit c3d8f22

Please sign in to comment.