Skip to content

Commit bb9b8fd

Browse files
committed
Merge tag 'kbuild-fixes-v4.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild fixes from Masahiro Yamada: "Nothing scary, just some random fixes: - fix warnings of host programs - fix "make tags" when COMPILED_SOURCE=1 is specified along with O= - clarify help message of C=1 option - fix dependency for ncurses compatibility check - fix "make headers_install" for fakechroot environment" * tag 'kbuild-fixes-v4.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kconfig: fix sparse warnings in nconfig kbuild: fix header installation under fakechroot environment kconfig: Check for libncurses before menuconfig Kbuild: tiny correction on `make help` tags: honor COMPILED_SOURCE with apart output directory genksyms: add printf format attribute to error_with_pos()
2 parents f65013d + ad81810 commit bb9b8fd

File tree

7 files changed

+21
-12
lines changed

7 files changed

+21
-12
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1437,7 +1437,7 @@ help:
14371437
@echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
14381438
@echo ' make V=2 [targets] 2 => give reason for rebuild of target'
14391439
@echo ' make O=dir [targets] Locate all output files in "dir", including .config'
1440-
@echo ' make C=1 [targets] Check all c source with $$CHECK (sparse by default)'
1440+
@echo ' make C=1 [targets] Check re-compiled c source with $$CHECK (sparse by default)'
14411441
@echo ' make C=2 [targets] Force check of all c source with $$CHECK'
14421442
@echo ' make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections'
14431443
@echo ' make W=n [targets] Enable extra gcc checks, n=1,2,3 where'

scripts/Makefile.headersinst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@ __headers:
1414
include scripts/Kbuild.include
1515

1616
srcdir := $(srctree)/$(obj)
17-
subdirs := $(patsubst $(srcdir)/%/.,%,$(wildcard $(srcdir)/*/.))
17+
18+
# When make is run under a fakechroot environment, the function
19+
# $(wildcard $(srcdir)/*/.) doesn't only return directories, but also regular
20+
# files. So, we are using a combination of sort/dir/wildcard which works
21+
# with fakechroot.
22+
subdirs := $(patsubst $(srcdir)/%/,%,\
23+
$(filter-out $(srcdir)/,\
24+
$(sort $(dir $(wildcard $(srcdir)/*/)))))
25+
1826
# caller may set destination dir (when installing to asm/)
1927
_dst := $(if $(dst),$(dst),$(obj))
2028

scripts/genksyms/genksyms.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ struct string_list *copy_list_range(struct string_list *start,
7575
int yylex(void);
7676
int yyparse(void);
7777

78-
void error_with_pos(const char *, ...);
78+
void error_with_pos(const char *, ...) __attribute__ ((format(printf, 1, 2)));
7979

8080
/*----------------------------------------------------------------------*/
8181
#define xmalloc(size) ({ void *__ptr = malloc(size); \

scripts/kconfig/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ clean-files += config.pot linux.pot
196196

197197
# Check that we have the required ncurses stuff installed for lxdialog (menuconfig)
198198
PHONY += $(obj)/dochecklxdialog
199-
$(addprefix $(obj)/,$(lxdialog)): $(obj)/dochecklxdialog
199+
$(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/dochecklxdialog
200200
$(obj)/dochecklxdialog:
201201
$(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTLOADLIBES_mconf)
202202

scripts/kconfig/nconf.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ static struct mitem k_menu_items[MAX_MENU_ITEMS];
271271
static int items_num;
272272
static int global_exit;
273273
/* the currently selected button */
274-
const char *current_instructions = menu_instructions;
274+
static const char *current_instructions = menu_instructions;
275275

276276
static char *dialog_input_result;
277277
static int dialog_input_result_len;
@@ -305,7 +305,7 @@ struct function_keys {
305305
};
306306

307307
static const int function_keys_num = 9;
308-
struct function_keys function_keys[] = {
308+
static struct function_keys function_keys[] = {
309309
{
310310
.key_str = "F1",
311311
.func = "Help",
@@ -508,7 +508,7 @@ static int get_mext_match(const char *match_str, match_f flag)
508508
index = (index + items_num) % items_num;
509509
while (true) {
510510
char *str = k_menu_items[index].str;
511-
if (strcasestr(str, match_str) != 0)
511+
if (strcasestr(str, match_str) != NULL)
512512
return index;
513513
if (flag == FIND_NEXT_MATCH_UP ||
514514
flag == MATCH_TINKER_PATTERN_UP)
@@ -1067,7 +1067,7 @@ static int do_match(int key, struct match_state *state, int *ans)
10671067

10681068
static void conf(struct menu *menu)
10691069
{
1070-
struct menu *submenu = 0;
1070+
struct menu *submenu = NULL;
10711071
const char *prompt = menu_get_prompt(menu);
10721072
struct symbol *sym;
10731073
int res;
@@ -1234,7 +1234,7 @@ static void show_help(struct menu *menu)
12341234
static void conf_choice(struct menu *menu)
12351235
{
12361236
const char *prompt = _(menu_get_prompt(menu));
1237-
struct menu *child = 0;
1237+
struct menu *child = NULL;
12381238
struct symbol *active;
12391239
int selected_index = 0;
12401240
int last_top_row = 0;
@@ -1456,7 +1456,7 @@ static void conf_save(void)
14561456
}
14571457
}
14581458

1459-
void setup_windows(void)
1459+
static void setup_windows(void)
14601460
{
14611461
int lines, columns;
14621462

scripts/kconfig/nconf.gui.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static void no_colors_theme(void)
129129
mkattrn(FUNCTION_TEXT, A_REVERSE);
130130
}
131131

132-
void set_colors()
132+
void set_colors(void)
133133
{
134134
start_color();
135135
use_default_colors();
@@ -192,7 +192,7 @@ const char *get_line(const char *text, int line_no)
192192
int lines = 0;
193193

194194
if (!text)
195-
return 0;
195+
return NULL;
196196

197197
for (i = 0; text[i] != '\0' && lines < line_no; i++)
198198
if (text[i] == '\n')

scripts/tags.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ all_compiled_sources()
106106
case "$i" in
107107
*.[cS])
108108
j=${i/\.[cS]/\.o}
109+
j="${j#$tree}"
109110
if [ -e $j ]; then
110111
echo $i
111112
fi

0 commit comments

Comments
 (0)