* [PATCH 1/5] kconfig: split some C files out of zconf.y
@ 2018-12-21 8:33 Masahiro Yamada
2018-12-21 8:33 ` [PATCH 2/5] kconfig: split the lexer " Masahiro Yamada
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Masahiro Yamada @ 2018-12-21 8:33 UTC (permalink / raw)
To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel
I want to compile each C file independently instead of including all
of them from zconf.y.
These 4 files are low hanging fruits.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
scripts/kconfig/Makefile | 19 +++++++++----------
scripts/kconfig/confdata.c | 1 +
scripts/kconfig/expr.c | 2 ++
scripts/kconfig/lkc.h | 1 +
scripts/kconfig/preprocess.c | 2 ++
scripts/kconfig/symbol.c | 2 +-
scripts/kconfig/zconf.y | 4 ----
7 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 63b6092..d3bd687 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -142,13 +142,8 @@ help:
@echo ' testconfig - Run Kconfig unit tests (requires python3 and pytest)'
# ===========================================================================
-# Shared Makefile for the various kconfig executables:
-# conf: Used for defconfig, oldconfig and related targets
# object files used by all kconfig flavours
-
-conf-objs := conf.o zconf.tab.o
-
-hostprogs-y := conf
+common-objs := confdata.o expr.o symbol.o preprocess.o zconf.tab.o
targets += zconf.lex.c
@@ -156,9 +151,13 @@ targets += zconf.lex.c
HOSTCFLAGS_zconf.lex.o := -I$(src)
HOSTCFLAGS_zconf.tab.o := -I$(src)
+# conf: Used for defconfig, oldconfig and related targets
+hostprogs-y += conf
+conf-objs := conf.o $(common-objs)
+
# nconf: Used for the nconfig target based on ncurses
hostprogs-y += nconf
-nconf-objs := nconf.o zconf.tab.o nconf.gui.o
+nconf-objs := nconf.o nconf.gui.o $(common-objs)
HOSTLDLIBS_nconf = $(shell . $(obj)/.nconf-cfg && echo $$libs)
HOSTCFLAGS_nconf.o = $(shell . $(obj)/.nconf-cfg && echo $$cflags)
@@ -169,7 +168,7 @@ $(obj)/nconf.o $(obj)/nconf.gui.o: $(obj)/.nconf-cfg
# mconf: Used for the menuconfig target based on lxdialog
hostprogs-y += mconf
lxdialog := checklist.o inputbox.o menubox.o textbox.o util.o yesno.o
-mconf-objs := mconf.o zconf.tab.o $(addprefix lxdialog/, $(lxdialog))
+mconf-objs := mconf.o $(addprefix lxdialog/, $(lxdialog)) $(common-objs)
HOSTLDLIBS_mconf = $(shell . $(obj)/.mconf-cfg && echo $$libs)
$(foreach f, mconf.o $(lxdialog), \
@@ -181,7 +180,7 @@ $(addprefix $(obj)/lxdialog/, $(lxdialog)): $(obj)/.mconf-cfg
# qconf: Used for the xconfig target based on Qt
hostprogs-y += qconf
qconf-cxxobjs := qconf.o
-qconf-objs := zconf.tab.o
+qconf-objs := $(common-objs)
HOSTLDLIBS_qconf = $(shell . $(obj)/.qconf-cfg && echo $$libs)
HOSTCXXFLAGS_qconf.o = $(shell . $(obj)/.qconf-cfg && echo $$cflags)
@@ -196,7 +195,7 @@ $(obj)/%.moc: $(src)/%.h $(obj)/.qconf-cfg
# gconf: Used for the gconfig target based on GTK+
hostprogs-y += gconf
-gconf-objs := gconf.o zconf.tab.o
+gconf-objs := gconf.o $(common-objs)
HOSTLDLIBS_gconf = $(shell . $(obj)/.gconf-cfg && echo $$libs)
HOSTCFLAGS_gconf.o = $(shell . $(obj)/.gconf-cfg && echo $$cflags)
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index e32ada9..ea88355 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -7,6 +7,7 @@
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
+#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c
index ddb9c86..265f2af 100644
--- a/scripts/kconfig/expr.c
+++ b/scripts/kconfig/expr.c
@@ -3,6 +3,8 @@
* Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
*/
+#include <ctype.h>
+#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index 4ff33cd..160a931 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -108,6 +108,7 @@ const char *str_get(struct gstr *gs);
/* symbol.c */
void sym_clear_all_valid(void);
struct symbol *sym_choice_default(struct symbol *sym);
+struct property *sym_get_range_prop(struct symbol *sym);
const char *sym_get_string_default(struct symbol *sym);
struct symbol *sym_check_deps(struct symbol *sym);
struct property *prop_alloc(enum prop_type type, struct symbol *sym);
diff --git a/scripts/kconfig/preprocess.c b/scripts/kconfig/preprocess.c
index b028a48..592dfbfa 100644
--- a/scripts/kconfig/preprocess.c
+++ b/scripts/kconfig/preprocess.c
@@ -2,6 +2,7 @@
//
// Copyright (C) 2018 Masahiro Yamada <yamada.masahiro@socionext.com>
+#include <ctype.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
@@ -9,6 +10,7 @@
#include <string.h>
#include "list.h"
+#include "lkc.h"
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 364afa1..860414d 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -88,7 +88,7 @@ static struct property *sym_get_default_prop(struct symbol *sym)
return NULL;
}
-static struct property *sym_get_range_prop(struct symbol *sym)
+struct property *sym_get_range_prop(struct symbol *sym)
{
struct property *prop;
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 60ee8e7..32be913 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -730,8 +730,4 @@ void zconfdump(FILE *out)
#include "zconf.lex.c"
#include "util.c"
-#include "confdata.c"
-#include "expr.c"
-#include "symbol.c"
#include "menu.c"
-#include "preprocess.c"
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/5] kconfig: split the lexer out of zconf.y
2018-12-21 8:33 [PATCH 1/5] kconfig: split some C files out of zconf.y Masahiro Yamada
@ 2018-12-21 8:33 ` Masahiro Yamada
2018-12-21 8:33 ` [PATCH 3/5] kconfig: add static qualifiers to fix gconf warnings Masahiro Yamada
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2018-12-21 8:33 UTC (permalink / raw)
To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel
Compile zconf.lex.c independently of the other files.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
scripts/kconfig/Makefile | 8 ++------
scripts/kconfig/lkc.h | 3 +++
scripts/kconfig/zconf.l | 1 +
scripts/kconfig/zconf.y | 2 --
4 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index d3bd687..65cdf8c 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -143,11 +143,9 @@ help:
# ===========================================================================
# object files used by all kconfig flavours
-common-objs := confdata.o expr.o symbol.o preprocess.o zconf.tab.o
+common-objs := confdata.o expr.o symbol.o preprocess.o zconf.lex.o zconf.tab.o
-targets += zconf.lex.c
-
-# generated files seem to need this to find local include files
+$(obj)/zconf.lex.o: $(obj)/zconf.tab.h
HOSTCFLAGS_zconf.lex.o := -I$(src)
HOSTCFLAGS_zconf.tab.o := -I$(src)
@@ -202,8 +200,6 @@ HOSTCFLAGS_gconf.o = $(shell . $(obj)/.gconf-cfg && echo $$cflags)
$(obj)/gconf.o: $(obj)/.gconf-cfg
-$(obj)/zconf.tab.o: $(obj)/zconf.lex.c
-
# check if necessary packages are available, and configure build flags
define filechk_conf_cfg
$(CONFIG_SHELL) $<
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index 160a931..531ff7c 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -90,6 +90,9 @@ void *xrealloc(void *p, size_t size);
char *xstrdup(const char *s);
char *xstrndup(const char *s, size_t n);
+/* zconf.l */
+int yylex(void);
+
struct gstr {
size_t len;
char *s;
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
index 960e6c6..a9a83eb 100644
--- a/scripts/kconfig/zconf.l
+++ b/scripts/kconfig/zconf.l
@@ -15,6 +15,7 @@
#include <unistd.h>
#include "lkc.h"
+#include "zconf.tab.h"
#define YY_DECL static int yylex1(void)
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 32be913..07719a7 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -20,7 +20,6 @@
int cdebug = PRINTD;
-int yylex(void);
static void yyerror(const char *err);
static void zconfprint(const char *err, ...);
static void zconf_error(const char *err, ...);
@@ -728,6 +727,5 @@ void zconfdump(FILE *out)
}
}
-#include "zconf.lex.c"
#include "util.c"
#include "menu.c"
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/5] kconfig: add static qualifiers to fix gconf warnings
2018-12-21 8:33 [PATCH 1/5] kconfig: split some C files out of zconf.y Masahiro Yamada
2018-12-21 8:33 ` [PATCH 2/5] kconfig: split the lexer " Masahiro Yamada
@ 2018-12-21 8:33 ` Masahiro Yamada
2018-12-21 8:33 ` [PATCH 4/5] kconfig: split images.c out of qconf.cc/gconf.c " Masahiro Yamada
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2018-12-21 8:33 UTC (permalink / raw)
To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel
Add "static" to functions that are locally used in gconf.c
This fixes some "no previous prototype for ..." warnings.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
scripts/kconfig/gconf.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 14fc0fa..2d4e5a1 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -76,7 +76,7 @@ static void conf_changed(void);
/* Helping/Debugging Functions */
-const char *dbg_sym_flags(int val)
+static const char *dbg_sym_flags(int val)
{
static char buf[256];
@@ -106,8 +106,8 @@ const char *dbg_sym_flags(int val)
return buf;
}
-void replace_button_icon(GladeXML * xml, GdkDrawable * window,
- GtkStyle * style, gchar * btn_name, gchar ** xpm)
+static void replace_button_icon(GladeXML *xml, GdkDrawable *window,
+ GtkStyle *style, gchar *btn_name, gchar **xpm)
{
GdkPixmap *pixmap;
GdkBitmap *mask;
@@ -125,7 +125,7 @@ void replace_button_icon(GladeXML * xml, GdkDrawable * window,
}
/* Main Window Initialization */
-void init_main_window(const gchar * glade_file)
+static void init_main_window(const gchar *glade_file)
{
GladeXML *xml;
GtkWidget *widget;
@@ -187,7 +187,7 @@ void init_main_window(const gchar * glade_file)
gtk_widget_show(main_wnd);
}
-void init_tree_model(void)
+static void init_tree_model(void)
{
gint i;
@@ -217,7 +217,7 @@ void init_tree_model(void)
model1 = GTK_TREE_MODEL(tree1);
}
-void init_left_tree(void)
+static void init_left_tree(void)
{
GtkTreeView *view = GTK_TREE_VIEW(tree1_w);
GtkCellRenderer *renderer;
@@ -259,7 +259,7 @@ static void renderer_edited(GtkCellRendererText * cell,
const gchar * path_string,
const gchar * new_text, gpointer user_data);
-void init_right_tree(void)
+static void init_right_tree(void)
{
GtkTreeView *view = GTK_TREE_VIEW(tree2_w);
GtkCellRenderer *renderer;
@@ -1209,8 +1209,8 @@ static GtkTreeIter found;
/*
* Find a menu in the GtkTree starting at parent.
*/
-GtkTreeIter *gtktree_iter_find_node(GtkTreeIter * parent,
- struct menu *tofind)
+static GtkTreeIter *gtktree_iter_find_node(GtkTreeIter *parent,
+ struct menu *tofind)
{
GtkTreeIter iter;
GtkTreeIter *child = &iter;
@@ -1421,7 +1421,7 @@ static void display_list(void)
tree = tree2;
}
-void fixup_rootmenu(struct menu *menu)
+static void fixup_rootmenu(struct menu *menu)
{
struct menu *child;
static int menu_cnt = 0;
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/5] kconfig: split images.c out of qconf.cc/gconf.c to fix gconf warnings
2018-12-21 8:33 [PATCH 1/5] kconfig: split some C files out of zconf.y Masahiro Yamada
2018-12-21 8:33 ` [PATCH 2/5] kconfig: split the lexer " Masahiro Yamada
2018-12-21 8:33 ` [PATCH 3/5] kconfig: add static qualifiers to fix gconf warnings Masahiro Yamada
@ 2018-12-21 8:33 ` Masahiro Yamada
2018-12-21 8:33 ` [PATCH 5/5] kconfig: surround dbg_sym_flags with #ifdef DEBUG to fix gconf warning Masahiro Yamada
2018-12-24 15:18 ` [PATCH 1/5] kconfig: split some C files out of zconf.y Masahiro Yamada
4 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2018-12-21 8:33 UTC (permalink / raw)
To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel
Currently, images.c is included by qconf.cc and gconf.c.
qconf.cc uses all of xpm_* arrays, but gconf.c only some of them.
Hence, lots of "... defined but not used" warnings are displayed
when compiling gconf.c
Splitting out images.c fixes the warnings.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
scripts/kconfig/Makefile | 4 ++--
scripts/kconfig/gconf.c | 2 +-
scripts/kconfig/images.c | 32 +++++++++++++++++---------------
scripts/kconfig/images.h | 33 +++++++++++++++++++++++++++++++++
scripts/kconfig/qconf.cc | 2 +-
5 files changed, 54 insertions(+), 19 deletions(-)
create mode 100644 scripts/kconfig/images.h
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 65cdf8c..ec204fa 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -178,7 +178,7 @@ $(addprefix $(obj)/lxdialog/, $(lxdialog)): $(obj)/.mconf-cfg
# qconf: Used for the xconfig target based on Qt
hostprogs-y += qconf
qconf-cxxobjs := qconf.o
-qconf-objs := $(common-objs)
+qconf-objs := images.o $(common-objs)
HOSTLDLIBS_qconf = $(shell . $(obj)/.qconf-cfg && echo $$libs)
HOSTCXXFLAGS_qconf.o = $(shell . $(obj)/.qconf-cfg && echo $$cflags)
@@ -193,7 +193,7 @@ $(obj)/%.moc: $(src)/%.h $(obj)/.qconf-cfg
# gconf: Used for the gconfig target based on GTK+
hostprogs-y += gconf
-gconf-objs := gconf.o $(common-objs)
+gconf-objs := gconf.o images.o $(common-objs)
HOSTLDLIBS_gconf = $(shell . $(obj)/.gconf-cfg && echo $$libs)
HOSTCFLAGS_gconf.o = $(shell . $(obj)/.gconf-cfg && echo $$cflags)
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 2d4e5a1..b3d438c 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -9,7 +9,7 @@
#include <stdlib.h>
#include "lkc.h"
-#include "images.c"
+#include "images.h"
#include <glade/glade.h>
#include <gtk/gtk.h>
diff --git a/scripts/kconfig/images.c b/scripts/kconfig/images.c
index ef43b81..b4fa0e4 100644
--- a/scripts/kconfig/images.c
+++ b/scripts/kconfig/images.c
@@ -3,7 +3,9 @@
* Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
*/
-static const char *xpm_load[] = {
+#include "images.h"
+
+const char *xpm_load[] = {
"22 22 5 1",
". c None",
"# c #000000",
@@ -33,7 +35,7 @@ static const char *xpm_load[] = {
"###############.......",
"......................"};
-static const char *xpm_save[] = {
+const char *xpm_save[] = {
"22 22 5 1",
". c None",
"# c #000000",
@@ -63,7 +65,7 @@ static const char *xpm_save[] = {
"..##################..",
"......................"};
-static const char *xpm_back[] = {
+const char *xpm_back[] = {
"22 22 3 1",
". c None",
"# c #000083",
@@ -91,7 +93,7 @@ static const char *xpm_back[] = {
"......................",
"......................"};
-static const char *xpm_tree_view[] = {
+const char *xpm_tree_view[] = {
"22 22 2 1",
". c None",
"# c #000000",
@@ -118,7 +120,7 @@ static const char *xpm_tree_view[] = {
"......................",
"......................"};
-static const char *xpm_single_view[] = {
+const char *xpm_single_view[] = {
"22 22 2 1",
". c None",
"# c #000000",
@@ -145,7 +147,7 @@ static const char *xpm_single_view[] = {
"......................",
"......................"};
-static const char *xpm_split_view[] = {
+const char *xpm_split_view[] = {
"22 22 2 1",
". c None",
"# c #000000",
@@ -172,7 +174,7 @@ static const char *xpm_split_view[] = {
"......................",
"......................"};
-static const char *xpm_symbol_no[] = {
+const char *xpm_symbol_no[] = {
"12 12 2 1",
" c white",
". c black",
@@ -189,7 +191,7 @@ static const char *xpm_symbol_no[] = {
" .......... ",
" "};
-static const char *xpm_symbol_mod[] = {
+const char *xpm_symbol_mod[] = {
"12 12 2 1",
" c white",
". c black",
@@ -206,7 +208,7 @@ static const char *xpm_symbol_mod[] = {
" .......... ",
" "};
-static const char *xpm_symbol_yes[] = {
+const char *xpm_symbol_yes[] = {
"12 12 2 1",
" c white",
". c black",
@@ -223,7 +225,7 @@ static const char *xpm_symbol_yes[] = {
" .......... ",
" "};
-static const char *xpm_choice_no[] = {
+const char *xpm_choice_no[] = {
"12 12 2 1",
" c white",
". c black",
@@ -240,7 +242,7 @@ static const char *xpm_choice_no[] = {
" .... ",
" "};
-static const char *xpm_choice_yes[] = {
+const char *xpm_choice_yes[] = {
"12 12 2 1",
" c white",
". c black",
@@ -257,7 +259,7 @@ static const char *xpm_choice_yes[] = {
" .... ",
" "};
-static const char *xpm_menu[] = {
+const char *xpm_menu[] = {
"12 12 2 1",
" c white",
". c black",
@@ -274,7 +276,7 @@ static const char *xpm_menu[] = {
" .......... ",
" "};
-static const char *xpm_menu_inv[] = {
+const char *xpm_menu_inv[] = {
"12 12 2 1",
" c white",
". c black",
@@ -291,7 +293,7 @@ static const char *xpm_menu_inv[] = {
" .......... ",
" "};
-static const char *xpm_menuback[] = {
+const char *xpm_menuback[] = {
"12 12 2 1",
" c white",
". c black",
@@ -308,7 +310,7 @@ static const char *xpm_menuback[] = {
" .......... ",
" "};
-static const char *xpm_void[] = {
+const char *xpm_void[] = {
"12 12 2 1",
" c white",
". c black",
diff --git a/scripts/kconfig/images.h b/scripts/kconfig/images.h
new file mode 100644
index 0000000..d8ff614
--- /dev/null
+++ b/scripts/kconfig/images.h
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
+ */
+
+#ifndef IMAGES_H
+#define IMAGES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern const char *xpm_load[];
+extern const char *xpm_save[];
+extern const char *xpm_back[];
+extern const char *xpm_tree_view[];
+extern const char *xpm_single_view[];
+extern const char *xpm_split_view[];
+extern const char *xpm_symbol_no[];
+extern const char *xpm_symbol_mod[];
+extern const char *xpm_symbol_yes[];
+extern const char *xpm_choice_no[];
+extern const char *xpm_choice_yes[];
+extern const char *xpm_menu[];
+extern const char *xpm_menu_inv[];
+extern const char *xpm_menuback[];
+extern const char *xpm_void[];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* IMAGES_H */
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index c897998..8be8a70 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -32,7 +32,7 @@
#include "qconf.h"
#include "qconf.moc"
-#include "images.c"
+#include "images.h"
static QApplication *configApp;
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 5/5] kconfig: surround dbg_sym_flags with #ifdef DEBUG to fix gconf warning
2018-12-21 8:33 [PATCH 1/5] kconfig: split some C files out of zconf.y Masahiro Yamada
` (2 preceding siblings ...)
2018-12-21 8:33 ` [PATCH 4/5] kconfig: split images.c out of qconf.cc/gconf.c " Masahiro Yamada
@ 2018-12-21 8:33 ` Masahiro Yamada
2018-12-24 15:18 ` [PATCH 1/5] kconfig: split some C files out of zconf.y Masahiro Yamada
4 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2018-12-21 8:33 UTC (permalink / raw)
To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel
Fix the following warning:
no previous prototype for ‘dbg_sym_flags’ [-Wmissing-prototypes]
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
scripts/kconfig/gconf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index b3d438c..5d4ecf3 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -75,7 +75,7 @@ static gchar **fill_row(struct menu *menu);
static void conf_changed(void);
/* Helping/Debugging Functions */
-
+#ifdef DEBUG
static const char *dbg_sym_flags(int val)
{
static char buf[256];
@@ -105,6 +105,7 @@ static const char *dbg_sym_flags(int val)
return buf;
}
+#endif
static void replace_button_icon(GladeXML *xml, GdkDrawable *window,
GtkStyle *style, gchar *btn_name, gchar **xpm)
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/5] kconfig: split some C files out of zconf.y
2018-12-21 8:33 [PATCH 1/5] kconfig: split some C files out of zconf.y Masahiro Yamada
` (3 preceding siblings ...)
2018-12-21 8:33 ` [PATCH 5/5] kconfig: surround dbg_sym_flags with #ifdef DEBUG to fix gconf warning Masahiro Yamada
@ 2018-12-24 15:18 ` Masahiro Yamada
4 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2018-12-24 15:18 UTC (permalink / raw)
To: Linux Kbuild mailing list; +Cc: Linux Kernel Mailing List
On Sat, Dec 22, 2018 at 12:24 AM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> I want to compile each C file independently instead of including all
> of them from zconf.y.
>
> These 4 files are low hanging fruits.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
Series, applied to linux-kbuild/kconfig.
> scripts/kconfig/Makefile | 19 +++++++++----------
> scripts/kconfig/confdata.c | 1 +
> scripts/kconfig/expr.c | 2 ++
> scripts/kconfig/lkc.h | 1 +
> scripts/kconfig/preprocess.c | 2 ++
> scripts/kconfig/symbol.c | 2 +-
> scripts/kconfig/zconf.y | 4 ----
> 7 files changed, 16 insertions(+), 15 deletions(-)
>
> diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
> index 63b6092..d3bd687 100644
> --- a/scripts/kconfig/Makefile
> +++ b/scripts/kconfig/Makefile
> @@ -142,13 +142,8 @@ help:
> @echo ' testconfig - Run Kconfig unit tests (requires python3 and pytest)'
>
> # ===========================================================================
> -# Shared Makefile for the various kconfig executables:
> -# conf: Used for defconfig, oldconfig and related targets
> # object files used by all kconfig flavours
> -
> -conf-objs := conf.o zconf.tab.o
> -
> -hostprogs-y := conf
> +common-objs := confdata.o expr.o symbol.o preprocess.o zconf.tab.o
>
> targets += zconf.lex.c
>
> @@ -156,9 +151,13 @@ targets += zconf.lex.c
> HOSTCFLAGS_zconf.lex.o := -I$(src)
> HOSTCFLAGS_zconf.tab.o := -I$(src)
>
> +# conf: Used for defconfig, oldconfig and related targets
> +hostprogs-y += conf
> +conf-objs := conf.o $(common-objs)
> +
> # nconf: Used for the nconfig target based on ncurses
> hostprogs-y += nconf
> -nconf-objs := nconf.o zconf.tab.o nconf.gui.o
> +nconf-objs := nconf.o nconf.gui.o $(common-objs)
>
> HOSTLDLIBS_nconf = $(shell . $(obj)/.nconf-cfg && echo $$libs)
> HOSTCFLAGS_nconf.o = $(shell . $(obj)/.nconf-cfg && echo $$cflags)
> @@ -169,7 +168,7 @@ $(obj)/nconf.o $(obj)/nconf.gui.o: $(obj)/.nconf-cfg
> # mconf: Used for the menuconfig target based on lxdialog
> hostprogs-y += mconf
> lxdialog := checklist.o inputbox.o menubox.o textbox.o util.o yesno.o
> -mconf-objs := mconf.o zconf.tab.o $(addprefix lxdialog/, $(lxdialog))
> +mconf-objs := mconf.o $(addprefix lxdialog/, $(lxdialog)) $(common-objs)
>
> HOSTLDLIBS_mconf = $(shell . $(obj)/.mconf-cfg && echo $$libs)
> $(foreach f, mconf.o $(lxdialog), \
> @@ -181,7 +180,7 @@ $(addprefix $(obj)/lxdialog/, $(lxdialog)): $(obj)/.mconf-cfg
> # qconf: Used for the xconfig target based on Qt
> hostprogs-y += qconf
> qconf-cxxobjs := qconf.o
> -qconf-objs := zconf.tab.o
> +qconf-objs := $(common-objs)
>
> HOSTLDLIBS_qconf = $(shell . $(obj)/.qconf-cfg && echo $$libs)
> HOSTCXXFLAGS_qconf.o = $(shell . $(obj)/.qconf-cfg && echo $$cflags)
> @@ -196,7 +195,7 @@ $(obj)/%.moc: $(src)/%.h $(obj)/.qconf-cfg
>
> # gconf: Used for the gconfig target based on GTK+
> hostprogs-y += gconf
> -gconf-objs := gconf.o zconf.tab.o
> +gconf-objs := gconf.o $(common-objs)
>
> HOSTLDLIBS_gconf = $(shell . $(obj)/.gconf-cfg && echo $$libs)
> HOSTCFLAGS_gconf.o = $(shell . $(obj)/.gconf-cfg && echo $$cflags)
> diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
> index e32ada9..ea88355 100644
> --- a/scripts/kconfig/confdata.c
> +++ b/scripts/kconfig/confdata.c
> @@ -7,6 +7,7 @@
> #include <ctype.h>
> #include <errno.h>
> #include <fcntl.h>
> +#include <limits.h>
> #include <stdarg.h>
> #include <stdio.h>
> #include <stdlib.h>
> diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c
> index ddb9c86..265f2af 100644
> --- a/scripts/kconfig/expr.c
> +++ b/scripts/kconfig/expr.c
> @@ -3,6 +3,8 @@
> * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
> */
>
> +#include <ctype.h>
> +#include <errno.h>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
> index 4ff33cd..160a931 100644
> --- a/scripts/kconfig/lkc.h
> +++ b/scripts/kconfig/lkc.h
> @@ -108,6 +108,7 @@ const char *str_get(struct gstr *gs);
> /* symbol.c */
> void sym_clear_all_valid(void);
> struct symbol *sym_choice_default(struct symbol *sym);
> +struct property *sym_get_range_prop(struct symbol *sym);
> const char *sym_get_string_default(struct symbol *sym);
> struct symbol *sym_check_deps(struct symbol *sym);
> struct property *prop_alloc(enum prop_type type, struct symbol *sym);
> diff --git a/scripts/kconfig/preprocess.c b/scripts/kconfig/preprocess.c
> index b028a48..592dfbfa 100644
> --- a/scripts/kconfig/preprocess.c
> +++ b/scripts/kconfig/preprocess.c
> @@ -2,6 +2,7 @@
> //
> // Copyright (C) 2018 Masahiro Yamada <yamada.masahiro@socionext.com>
>
> +#include <ctype.h>
> #include <stdarg.h>
> #include <stdbool.h>
> #include <stdio.h>
> @@ -9,6 +10,7 @@
> #include <string.h>
>
> #include "list.h"
> +#include "lkc.h"
>
> #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
>
> diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
> index 364afa1..860414d 100644
> --- a/scripts/kconfig/symbol.c
> +++ b/scripts/kconfig/symbol.c
> @@ -88,7 +88,7 @@ static struct property *sym_get_default_prop(struct symbol *sym)
> return NULL;
> }
>
> -static struct property *sym_get_range_prop(struct symbol *sym)
> +struct property *sym_get_range_prop(struct symbol *sym)
> {
> struct property *prop;
>
> diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
> index 60ee8e7..32be913 100644
> --- a/scripts/kconfig/zconf.y
> +++ b/scripts/kconfig/zconf.y
> @@ -730,8 +730,4 @@ void zconfdump(FILE *out)
>
> #include "zconf.lex.c"
> #include "util.c"
> -#include "confdata.c"
> -#include "expr.c"
> -#include "symbol.c"
> #include "menu.c"
> -#include "preprocess.c"
> --
> 2.7.4
>
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-12-24 15:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-21 8:33 [PATCH 1/5] kconfig: split some C files out of zconf.y Masahiro Yamada
2018-12-21 8:33 ` [PATCH 2/5] kconfig: split the lexer " Masahiro Yamada
2018-12-21 8:33 ` [PATCH 3/5] kconfig: add static qualifiers to fix gconf warnings Masahiro Yamada
2018-12-21 8:33 ` [PATCH 4/5] kconfig: split images.c out of qconf.cc/gconf.c " Masahiro Yamada
2018-12-21 8:33 ` [PATCH 5/5] kconfig: surround dbg_sym_flags with #ifdef DEBUG to fix gconf warning Masahiro Yamada
2018-12-24 15:18 ` [PATCH 1/5] kconfig: split some C files out of zconf.y Masahiro Yamada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).