aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-03-03 13:37:01 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-03-03 13:37:01 -0500
commit0eb3412a68c354c0aa4adc4a24ec533154bd2172 (patch)
tree16ee01b2ecf7ca70ce0d04db3191d30938278b3d /scripts
parent7cf901b3551232776207adf14e72e48a008a6569 (diff)
parent50186e121ea1adcc43d0f9f790ee45e0b0f1202f (diff)
Merge tag 'kbuild-fixes-v4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild fixes from Masahiro Yamada: - suppress sparse warnings about unknown attributes - fix typos and stale comments - fix build error of arch/sh - fix wrong use of ld-option vs cc-ldoption - remove redundant GCC_PLUGINS_CFLAGS assignment - fix another memory leak of Kconfig - fix line number in error messages of Kconfig - do not write confusing CONFIG_DEFCONFIG_LIST out to .config - add xstrdup() to Kconfig to handle memory shortage errors - show also a Debian package name if ncurses is missing * tag 'kbuild-fixes-v4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: MAINTAINERS: take over Kconfig maintainership kconfig: fix line number in recursive inclusion error message Coccinelle: memdup: Fix typo in warning messages kconfig: Update ncurses package names for menuconfig kbuild/kallsyms: trivial typo fix kbuild: test --build-id linker flag by ld-option instead of cc-ldoption kbuild: drop superfluous GCC_PLUGINS_CFLAGS assignment kconfig: Don't leak choice names during parsing sh: fix build error for empty CONFIG_BUILTIN_DTB_SOURCE kconfig: set SYMBOL_AUTO to the symbol marked with defconfig_list kconfig: add xstrdup() helper kbuild: disable sparse warnings about unknown attributes Makefile: Fix lying comment re. silentoldconfig
Diffstat (limited to 'scripts')
-rw-r--r--scripts/coccinelle/api/memdup.cocci4
-rw-r--r--scripts/kallsyms.c2
-rw-r--r--scripts/kconfig/confdata.c2
-rw-r--r--scripts/kconfig/kxgettext.c2
-rw-r--r--scripts/kconfig/lkc.h1
-rwxr-xr-xscripts/kconfig/lxdialog/check-lxdialog.sh3
-rw-r--r--scripts/kconfig/menu.c1
-rw-r--r--scripts/kconfig/symbol.c4
-rw-r--r--scripts/kconfig/util.c11
-rw-r--r--scripts/kconfig/zconf.l12
-rw-r--r--scripts/kconfig/zconf.y3
-rwxr-xr-xscripts/link-vmlinux.sh2
12 files changed, 29 insertions, 18 deletions
diff --git a/scripts/coccinelle/api/memdup.cocci b/scripts/coccinelle/api/memdup.cocci
index 1249b727644b..8fd6437beda8 100644
--- a/scripts/coccinelle/api/memdup.cocci
+++ b/scripts/coccinelle/api/memdup.cocci
@@ -56,10 +56,10 @@ statement S;
56p << r.p; 56p << r.p;
57@@ 57@@
58 58
59coccilib.org.print_todo(p[0], "WARNING opportunity for kmemdep") 59coccilib.org.print_todo(p[0], "WARNING opportunity for kmemdup")
60 60
61@script:python depends on report@ 61@script:python depends on report@
62p << r.p; 62p << r.p;
63@@ 63@@
64 64
65coccilib.report.print_report(p[0], "WARNING opportunity for kmemdep") 65coccilib.report.print_report(p[0], "WARNING opportunity for kmemdup")
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 9ee9bf7fd1a2..65792650c630 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -595,7 +595,7 @@ static void optimize_result(void)
595 * original char code */ 595 * original char code */
596 if (!best_table_len[i]) { 596 if (!best_table_len[i]) {
597 597
598 /* find the token with the breates profit value */ 598 /* find the token with the best profit value */
599 best = find_best_token(); 599 best = find_best_token();
600 if (token_profit[best] == 0) 600 if (token_profit[best] == 0)
601 break; 601 break;
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 5c12dc91ef34..df26c7b0fe13 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -178,7 +178,7 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
178 case S_HEX: 178 case S_HEX:
179 done: 179 done:
180 if (sym_string_valid(sym, p)) { 180 if (sym_string_valid(sym, p)) {
181 sym->def[def].val = strdup(p); 181 sym->def[def].val = xstrdup(p);
182 sym->flags |= def_flags; 182 sym->flags |= def_flags;
183 } else { 183 } else {
184 if (def != S_DEF_AUTO) 184 if (def != S_DEF_AUTO)
diff --git a/scripts/kconfig/kxgettext.c b/scripts/kconfig/kxgettext.c
index 2858738b22d5..240880a89111 100644
--- a/scripts/kconfig/kxgettext.c
+++ b/scripts/kconfig/kxgettext.c
@@ -101,7 +101,7 @@ static struct message *message__new(const char *msg, char *option,
101 if (self->files == NULL) 101 if (self->files == NULL)
102 goto out_fail; 102 goto out_fail;
103 103
104 self->msg = strdup(msg); 104 self->msg = xstrdup(msg);
105 if (self->msg == NULL) 105 if (self->msg == NULL)
106 goto out_fail_msg; 106 goto out_fail_msg;
107 107
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index 4e23febbe4b2..2d5ec2d0e952 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -115,6 +115,7 @@ int file_write_dep(const char *name);
115void *xmalloc(size_t size); 115void *xmalloc(size_t size);
116void *xcalloc(size_t nmemb, size_t size); 116void *xcalloc(size_t nmemb, size_t size);
117void *xrealloc(void *p, size_t size); 117void *xrealloc(void *p, size_t size);
118char *xstrdup(const char *s);
118 119
119struct gstr { 120struct gstr {
120 size_t len; 121 size_t len;
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh
index a10bd9d6fafd..6c0bcd9c472d 100755
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -55,7 +55,8 @@ EOF
55 echo " *** required header files." 1>&2 55 echo " *** required header files." 1>&2
56 echo " *** 'make menuconfig' requires the ncurses libraries." 1>&2 56 echo " *** 'make menuconfig' requires the ncurses libraries." 1>&2
57 echo " *** " 1>&2 57 echo " *** " 1>&2
58 echo " *** Install ncurses (ncurses-devel) and try again." 1>&2 58 echo " *** Install ncurses (ncurses-devel or libncurses-dev " 1>&2
59 echo " *** depending on your distribution) and try again." 1>&2
59 echo " *** " 1>&2 60 echo " *** " 1>&2
60 exit 1 61 exit 1
61 fi 62 fi
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 99222855544c..36cd3e1f1c28 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -212,6 +212,7 @@ void menu_add_option(int token, char *arg)
212 sym_defconfig_list = current_entry->sym; 212 sym_defconfig_list = current_entry->sym;
213 else if (sym_defconfig_list != current_entry->sym) 213 else if (sym_defconfig_list != current_entry->sym)
214 zconf_error("trying to redefine defconfig symbol"); 214 zconf_error("trying to redefine defconfig symbol");
215 sym_defconfig_list->flags |= SYMBOL_AUTO;
215 break; 216 break;
216 case T_OPT_ENV: 217 case T_OPT_ENV:
217 prop_add_env(arg); 218 prop_add_env(arg);
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index cca9663be5dd..2220bc4b051b 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -183,7 +183,7 @@ static void sym_validate_range(struct symbol *sym)
183 sprintf(str, "%lld", val2); 183 sprintf(str, "%lld", val2);
184 else 184 else
185 sprintf(str, "0x%llx", val2); 185 sprintf(str, "0x%llx", val2);
186 sym->curr.val = strdup(str); 186 sym->curr.val = xstrdup(str);
187} 187}
188 188
189static void sym_set_changed(struct symbol *sym) 189static void sym_set_changed(struct symbol *sym)
@@ -849,7 +849,7 @@ struct symbol *sym_lookup(const char *name, int flags)
849 : !(symbol->flags & (SYMBOL_CONST|SYMBOL_CHOICE)))) 849 : !(symbol->flags & (SYMBOL_CONST|SYMBOL_CHOICE))))
850 return symbol; 850 return symbol;
851 } 851 }
852 new_name = strdup(name); 852 new_name = xstrdup(name);
853 } else { 853 } else {
854 new_name = NULL; 854 new_name = NULL;
855 hash = 0; 855 hash = 0;
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c
index b98a79e30e04..c6f6e21b809f 100644
--- a/scripts/kconfig/util.c
+++ b/scripts/kconfig/util.c
@@ -154,3 +154,14 @@ void *xrealloc(void *p, size_t size)
154 fprintf(stderr, "Out of memory.\n"); 154 fprintf(stderr, "Out of memory.\n");
155 exit(1); 155 exit(1);
156} 156}
157
158char *xstrdup(const char *s)
159{
160 char *p;
161
162 p = strdup(s);
163 if (p)
164 return p;
165 fprintf(stderr, "Out of memory.\n");
166 exit(1);
167}
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
index 02de6fe302a9..88b650eb9cc9 100644
--- a/scripts/kconfig/zconf.l
+++ b/scripts/kconfig/zconf.l
@@ -332,16 +332,12 @@ void zconf_nextfile(const char *name)
332 "Inclusion path:\n current file : '%s'\n", 332 "Inclusion path:\n current file : '%s'\n",
333 zconf_curname(), zconf_lineno(), 333 zconf_curname(), zconf_lineno(),
334 zconf_curname()); 334 zconf_curname());
335 iter = current_file->parent; 335 iter = current_file;
336 while (iter && \ 336 do {
337 strcmp(iter->name,current_file->name)) {
338 fprintf(stderr, " included from: '%s:%d'\n",
339 iter->name, iter->lineno-1);
340 iter = iter->parent; 337 iter = iter->parent;
341 }
342 if (iter)
343 fprintf(stderr, " included from: '%s:%d'\n", 338 fprintf(stderr, " included from: '%s:%d'\n",
344 iter->name, iter->lineno+1); 339 iter->name, iter->lineno - 1);
340 } while (strcmp(iter->name, current_file->name));
345 exit(1); 341 exit(1);
346 } 342 }
347 } 343 }
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 4be98050b961..ad6305b0f40c 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -127,7 +127,7 @@ no_mainmenu_stmt: /* empty */
127 * later regardless of whether it comes from the 'prompt' in 127 * later regardless of whether it comes from the 'prompt' in
128 * mainmenu_stmt or here 128 * mainmenu_stmt or here
129 */ 129 */
130 menu_add_prompt(P_MENU, strdup("Linux Kernel Configuration"), NULL); 130 menu_add_prompt(P_MENU, xstrdup("Linux Kernel Configuration"), NULL);
131}; 131};
132 132
133 133
@@ -276,6 +276,7 @@ choice: T_CHOICE word_opt T_EOL
276 sym->flags |= SYMBOL_AUTO; 276 sym->flags |= SYMBOL_AUTO;
277 menu_add_entry(sym); 277 menu_add_entry(sym);
278 menu_add_expr(P_CHOICE, NULL, NULL); 278 menu_add_expr(P_CHOICE, NULL, NULL);
279 free($2);
279 printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno()); 280 printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
280}; 281};
281 282
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index c0d129d7f430..be56a1153014 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -246,7 +246,7 @@ else
246fi; 246fi;
247 247
248# final build of init/ 248# final build of init/
249${MAKE} -f "${srctree}/scripts/Makefile.build" obj=init GCC_PLUGINS_CFLAGS="${GCC_PLUGINS_CFLAGS}" 249${MAKE} -f "${srctree}/scripts/Makefile.build" obj=init
250 250
251archive_builtin 251archive_builtin
252 252