diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-09 22:32:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-09 22:32:41 -0500 |
commit | 9a61df9e5f7471fe5be3e02bd0bed726b2761a54 (patch) | |
tree | d10ace20372c87b37919fa704d14cecdde3a35ce | |
parent | 7a501609c2cb73381e925827c504a4c2c2cb0817 (diff) | |
parent | 523ca58b7db2e30e3c185a7927dd80a30c1bc743 (diff) |
Merge tag 'kbuild-v4.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull more Kbuild updates from Masahiro Yamada:
"Makefile changes:
- enable unused-variable warning that was wrongly disabled for clang
Kconfig changes:
- warn about blank 'help' and fix existing instances
- fix 'choice' behavior to not write out invisible symbols
- fix misc weirdness
Coccinell changes:
- fix false positive of free after managed memory alloc detection
- improve performance of NULL dereference detection"
* tag 'kbuild-v4.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (21 commits)
kconfig: remove const qualifier from sym_expand_string_value()
kconfig: add xrealloc() helper
kconfig: send error messages to stderr
kconfig: echo stdin to stdout if either is redirected
kconfig: remove check_stdin()
kconfig: remove 'config*' pattern from .gitignnore
kconfig: show '?' prompt even if no help text is available
kconfig: do not write choice values when their dependency becomes n
coccinelle: deref_null: avoid useless computation
coccinelle: devm_free: reduce false positives
kbuild: clang: disable unused variable warnings only when constant
kconfig: Warn if help text is blank
nios2: kconfig: Remove blank help text
arm: vt8500: kconfig: Remove blank help text
MIPS: kconfig: Remove blank help text
MIPS: BCM63XX: kconfig: Remove blank help text
lib/Kconfig.debug: Remove blank help text
Staging: rtl8192e: kconfig: Remove blank help text
Staging: rtl8192u: kconfig: Remove blank help text
mmc: kconfig: Remove blank help text
...
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | arch/arm/mach-vt8500/Kconfig | 1 | ||||
-rw-r--r-- | arch/mips/Kconfig | 1 | ||||
-rw-r--r-- | arch/mips/bcm63xx/boards/Kconfig | 1 | ||||
-rw-r--r-- | arch/nios2/Kconfig | 1 | ||||
-rw-r--r-- | drivers/mmc/host/Kconfig | 1 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/Kconfig | 1 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/Kconfig | 1 | ||||
-rw-r--r-- | drivers/video/fbdev/Kconfig | 1 | ||||
-rw-r--r-- | lib/Kconfig.debug | 1 | ||||
-rw-r--r-- | scripts/coccinelle/free/devm_free.cocci | 55 | ||||
-rw-r--r-- | scripts/coccinelle/null/deref_null.cocci | 6 | ||||
-rw-r--r-- | scripts/kconfig/.gitignore | 1 | ||||
-rw-r--r-- | scripts/kconfig/conf.c | 40 | ||||
-rw-r--r-- | scripts/kconfig/confdata.c | 2 | ||||
-rw-r--r-- | scripts/kconfig/expr.c | 4 | ||||
-rw-r--r-- | scripts/kconfig/lkc.h | 1 | ||||
-rw-r--r-- | scripts/kconfig/lkc_proto.h | 2 | ||||
-rw-r--r-- | scripts/kconfig/nconf.gui.c | 3 | ||||
-rw-r--r-- | scripts/kconfig/symbol.c | 22 | ||||
-rw-r--r-- | scripts/kconfig/util.c | 15 | ||||
-rw-r--r-- | scripts/kconfig/zconf.l | 29 | ||||
-rw-r--r-- | scripts/kconfig/zconf.y | 6 |
23 files changed, 121 insertions, 77 deletions
@@ -729,7 +729,6 @@ endif | |||
729 | 729 | ||
730 | ifeq ($(cc-name),clang) | 730 | ifeq ($(cc-name),clang) |
731 | KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) | 731 | KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) |
732 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable) | ||
733 | KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier) | 732 | KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier) |
734 | KBUILD_CFLAGS += $(call cc-disable-warning, gnu) | 733 | KBUILD_CFLAGS += $(call cc-disable-warning, gnu) |
735 | KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) | 734 | KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) |
@@ -747,9 +746,9 @@ else | |||
747 | # These warnings generated too much noise in a regular build. | 746 | # These warnings generated too much noise in a regular build. |
748 | # Use make W=1 to enable them (see scripts/Makefile.extrawarn) | 747 | # Use make W=1 to enable them (see scripts/Makefile.extrawarn) |
749 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) | 748 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) |
750 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) | ||
751 | endif | 749 | endif |
752 | 750 | ||
751 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) | ||
753 | ifdef CONFIG_FRAME_POINTER | 752 | ifdef CONFIG_FRAME_POINTER |
754 | KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls | 753 | KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls |
755 | else | 754 | else |
diff --git a/arch/arm/mach-vt8500/Kconfig b/arch/arm/mach-vt8500/Kconfig index 1156a585dafc..8841199058ea 100644 --- a/arch/arm/mach-vt8500/Kconfig +++ b/arch/arm/mach-vt8500/Kconfig | |||
@@ -13,7 +13,6 @@ config ARCH_WM8505 | |||
13 | depends on ARCH_MULTI_V5 | 13 | depends on ARCH_MULTI_V5 |
14 | select ARCH_VT8500 | 14 | select ARCH_VT8500 |
15 | select CPU_ARM926T | 15 | select CPU_ARM926T |
16 | help | ||
17 | 16 | ||
18 | config ARCH_WM8750 | 17 | config ARCH_WM8750 |
19 | bool "WonderMedia WM8750" | 18 | bool "WonderMedia WM8750" |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 449397c60b56..8128c3b68d6b 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -2333,7 +2333,6 @@ config MIPS_VPE_LOADER_TOM | |||
2333 | config MIPS_VPE_APSP_API | 2333 | config MIPS_VPE_APSP_API |
2334 | bool "Enable support for AP/SP API (RTLX)" | 2334 | bool "Enable support for AP/SP API (RTLX)" |
2335 | depends on MIPS_VPE_LOADER | 2335 | depends on MIPS_VPE_LOADER |
2336 | help | ||
2337 | 2336 | ||
2338 | config MIPS_VPE_APSP_API_CMP | 2337 | config MIPS_VPE_APSP_API_CMP |
2339 | bool | 2338 | bool |
diff --git a/arch/mips/bcm63xx/boards/Kconfig b/arch/mips/bcm63xx/boards/Kconfig index 6ff0a7481081..f60d96610ace 100644 --- a/arch/mips/bcm63xx/boards/Kconfig +++ b/arch/mips/bcm63xx/boards/Kconfig | |||
@@ -7,6 +7,5 @@ choice | |||
7 | config BOARD_BCM963XX | 7 | config BOARD_BCM963XX |
8 | bool "Generic Broadcom 963xx boards" | 8 | bool "Generic Broadcom 963xx boards" |
9 | select SSB | 9 | select SSB |
10 | help | ||
11 | 10 | ||
12 | endchoice | 11 | endchoice |
diff --git a/arch/nios2/Kconfig b/arch/nios2/Kconfig index 60fae03dac79..3d4ec88f1db1 100644 --- a/arch/nios2/Kconfig +++ b/arch/nios2/Kconfig | |||
@@ -152,7 +152,6 @@ menu "Advanced setup" | |||
152 | 152 | ||
153 | config ADVANCED_OPTIONS | 153 | config ADVANCED_OPTIONS |
154 | bool "Prompt for advanced kernel configuration options" | 154 | bool "Prompt for advanced kernel configuration options" |
155 | help | ||
156 | 155 | ||
157 | comment "Default settings for advanced configuration options are used" | 156 | comment "Default settings for advanced configuration options are used" |
158 | depends on !ADVANCED_OPTIONS | 157 | depends on !ADVANCED_OPTIONS |
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 0eae619419d9..620c2d90a646 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig | |||
@@ -874,7 +874,6 @@ config MMC_CQHCI | |||
874 | config MMC_TOSHIBA_PCI | 874 | config MMC_TOSHIBA_PCI |
875 | tristate "Toshiba Type A SD/MMC Card Interface Driver" | 875 | tristate "Toshiba Type A SD/MMC Card Interface Driver" |
876 | depends on PCI | 876 | depends on PCI |
877 | help | ||
878 | 877 | ||
879 | config MMC_BCM2835 | 878 | config MMC_BCM2835 |
880 | tristate "Broadcom BCM2835 SDHOST MMC Controller support" | 879 | tristate "Broadcom BCM2835 SDHOST MMC Controller support" |
diff --git a/drivers/staging/rtl8192e/rtl8192e/Kconfig b/drivers/staging/rtl8192e/rtl8192e/Kconfig index 282e293da18f..7ac42a590e21 100644 --- a/drivers/staging/rtl8192e/rtl8192e/Kconfig +++ b/drivers/staging/rtl8192e/rtl8192e/Kconfig | |||
@@ -6,4 +6,3 @@ config RTL8192E | |||
6 | select WEXT_PRIV | 6 | select WEXT_PRIV |
7 | select CRYPTO | 7 | select CRYPTO |
8 | select FW_LOADER | 8 | select FW_LOADER |
9 | ---help--- | ||
diff --git a/drivers/staging/rtl8192u/Kconfig b/drivers/staging/rtl8192u/Kconfig index 3ee9d0d00fb6..97df6507a485 100644 --- a/drivers/staging/rtl8192u/Kconfig +++ b/drivers/staging/rtl8192u/Kconfig | |||
@@ -5,4 +5,3 @@ config RTL8192U | |||
5 | select WIRELESS_EXT | 5 | select WIRELESS_EXT |
6 | select WEXT_PRIV | 6 | select WEXT_PRIV |
7 | select CRYPTO | 7 | select CRYPTO |
8 | ---help--- | ||
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index 6962b4583fd7..11e699f1062b 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig | |||
@@ -1156,7 +1156,6 @@ config FB_I810_I2C | |||
1156 | bool "Enable DDC Support" | 1156 | bool "Enable DDC Support" |
1157 | depends on FB_I810 && FB_I810_GTF | 1157 | depends on FB_I810 && FB_I810_GTF |
1158 | select FB_DDC | 1158 | select FB_DDC |
1159 | help | ||
1160 | 1159 | ||
1161 | config FB_LE80578 | 1160 | config FB_LE80578 |
1162 | tristate "Intel LE80578 (Vermilion) support" | 1161 | tristate "Intel LE80578 (Vermilion) support" |
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index b66c264d4194..6088408ef26c 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -351,7 +351,6 @@ config SECTION_MISMATCH_WARN_ONLY | |||
351 | # | 351 | # |
352 | config ARCH_WANT_FRAME_POINTERS | 352 | config ARCH_WANT_FRAME_POINTERS |
353 | bool | 353 | bool |
354 | help | ||
355 | 354 | ||
356 | config FRAME_POINTER | 355 | config FRAME_POINTER |
357 | bool "Compile the kernel with frame pointers" | 356 | bool "Compile the kernel with frame pointers" |
diff --git a/scripts/coccinelle/free/devm_free.cocci b/scripts/coccinelle/free/devm_free.cocci index c990d2c7ee16..b2a2cf8bf81f 100644 --- a/scripts/coccinelle/free/devm_free.cocci +++ b/scripts/coccinelle/free/devm_free.cocci | |||
@@ -56,9 +56,62 @@ expression x; | |||
56 | x = devm_ioport_map(...) | 56 | x = devm_ioport_map(...) |
57 | ) | 57 | ) |
58 | 58 | ||
59 | @safe depends on context || org || report exists@ | ||
60 | expression x; | ||
61 | position p; | ||
62 | @@ | ||
63 | |||
64 | ( | ||
65 | x = kmalloc(...) | ||
66 | | | ||
67 | x = kvasprintf(...) | ||
68 | | | ||
69 | x = kasprintf(...) | ||
70 | | | ||
71 | x = kzalloc(...) | ||
72 | | | ||
73 | x = kmalloc_array(...) | ||
74 | | | ||
75 | x = kcalloc(...) | ||
76 | | | ||
77 | x = kstrdup(...) | ||
78 | | | ||
79 | x = kmemdup(...) | ||
80 | | | ||
81 | x = get_free_pages(...) | ||
82 | | | ||
83 | x = request_irq(...) | ||
84 | | | ||
85 | x = ioremap(...) | ||
86 | | | ||
87 | x = ioremap_nocache(...) | ||
88 | | | ||
89 | x = ioport_map(...) | ||
90 | ) | ||
91 | ... | ||
92 | ( | ||
93 | kfree@p(x) | ||
94 | | | ||
95 | kzfree@p(x) | ||
96 | | | ||
97 | __krealloc@p(x, ...) | ||
98 | | | ||
99 | krealloc@p(x, ...) | ||
100 | | | ||
101 | free_pages@p(x, ...) | ||
102 | | | ||
103 | free_page@p(x) | ||
104 | | | ||
105 | free_irq@p(x) | ||
106 | | | ||
107 | iounmap@p(x) | ||
108 | | | ||
109 | ioport_unmap@p(x) | ||
110 | ) | ||
111 | |||
59 | @pb@ | 112 | @pb@ |
60 | expression r.x; | 113 | expression r.x; |
61 | position p; | 114 | position p != safe.p; |
62 | @@ | 115 | @@ |
63 | 116 | ||
64 | ( | 117 | ( |
diff --git a/scripts/coccinelle/null/deref_null.cocci b/scripts/coccinelle/null/deref_null.cocci index f192d6035d02..b16ccb7663a7 100644 --- a/scripts/coccinelle/null/deref_null.cocci +++ b/scripts/coccinelle/null/deref_null.cocci | |||
@@ -212,7 +212,7 @@ else S3 | |||
212 | // The following three rules are duplicates of ifm, pr1 and pr2 respectively. | 212 | // The following three rules are duplicates of ifm, pr1 and pr2 respectively. |
213 | // It is need because the previous rule as already made a "change". | 213 | // It is need because the previous rule as already made a "change". |
214 | 214 | ||
215 | @ifm1@ | 215 | @ifm1 depends on context && !org && !report@ |
216 | expression *E; | 216 | expression *E; |
217 | statement S1,S2; | 217 | statement S1,S2; |
218 | position p1; | 218 | position p1; |
@@ -220,7 +220,7 @@ position p1; | |||
220 | 220 | ||
221 | if@p1 ((E == NULL && ...) || ...) S1 else S2 | 221 | if@p1 ((E == NULL && ...) || ...) S1 else S2 |
222 | 222 | ||
223 | @pr11 expression@ | 223 | @pr11 depends on context && !org && !report expression@ |
224 | expression *ifm1.E; | 224 | expression *ifm1.E; |
225 | identifier f; | 225 | identifier f; |
226 | position p1; | 226 | position p1; |
@@ -228,7 +228,7 @@ position p1; | |||
228 | 228 | ||
229 | (E != NULL && ...) ? <+...E->f@p1...+> : ... | 229 | (E != NULL && ...) ? <+...E->f@p1...+> : ... |
230 | 230 | ||
231 | @pr12 expression@ | 231 | @pr12 depends on context && !org && !report expression@ |
232 | expression *ifm1.E; | 232 | expression *ifm1.E; |
233 | identifier f; | 233 | identifier f; |
234 | position p2; | 234 | position p2; |
diff --git a/scripts/kconfig/.gitignore b/scripts/kconfig/.gitignore index 51f1c877b543..a76856e559c0 100644 --- a/scripts/kconfig/.gitignore +++ b/scripts/kconfig/.gitignore | |||
@@ -1,7 +1,6 @@ | |||
1 | # | 1 | # |
2 | # Generated files | 2 | # Generated files |
3 | # | 3 | # |
4 | config* | ||
5 | *.lex.c | 4 | *.lex.c |
6 | *.tab.c | 5 | *.tab.c |
7 | *.tab.h | 6 | *.tab.h |
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 307bc3f7b945..822dc51923d6 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c | |||
@@ -39,7 +39,6 @@ static enum input_mode input_mode = oldaskconfig; | |||
39 | 39 | ||
40 | static int indent = 1; | 40 | static int indent = 1; |
41 | static int tty_stdio; | 41 | static int tty_stdio; |
42 | static int valid_stdin = 1; | ||
43 | static int sync_kconfig; | 42 | static int sync_kconfig; |
44 | static int conf_cnt; | 43 | static int conf_cnt; |
45 | static char line[PATH_MAX]; | 44 | static char line[PATH_MAX]; |
@@ -72,21 +71,14 @@ static void strip(char *str) | |||
72 | *p-- = 0; | 71 | *p-- = 0; |
73 | } | 72 | } |
74 | 73 | ||
75 | static void check_stdin(void) | ||
76 | { | ||
77 | if (!valid_stdin) { | ||
78 | printf(_("aborted!\n\n")); | ||
79 | printf(_("Console input/output is redirected. ")); | ||
80 | printf(_("Run 'make oldconfig' to update configuration.\n\n")); | ||
81 | exit(1); | ||
82 | } | ||
83 | } | ||
84 | |||
85 | /* Helper function to facilitate fgets() by Jean Sacren. */ | 74 | /* Helper function to facilitate fgets() by Jean Sacren. */ |
86 | static void xfgets(char *str, int size, FILE *in) | 75 | static void xfgets(char *str, int size, FILE *in) |
87 | { | 76 | { |
88 | if (!fgets(str, size, in)) | 77 | if (!fgets(str, size, in)) |
89 | fprintf(stderr, "\nError in reading or end of file.\n"); | 78 | fprintf(stderr, "\nError in reading or end of file.\n"); |
79 | |||
80 | if (!tty_stdio) | ||
81 | printf("%s", str); | ||
90 | } | 82 | } |
91 | 83 | ||
92 | static int conf_askvalue(struct symbol *sym, const char *def) | 84 | static int conf_askvalue(struct symbol *sym, const char *def) |
@@ -113,13 +105,10 @@ static int conf_askvalue(struct symbol *sym, const char *def) | |||
113 | printf("%s\n", def); | 105 | printf("%s\n", def); |
114 | return 0; | 106 | return 0; |
115 | } | 107 | } |
116 | check_stdin(); | ||
117 | /* fall through */ | 108 | /* fall through */ |
118 | case oldaskconfig: | 109 | case oldaskconfig: |
119 | fflush(stdout); | 110 | fflush(stdout); |
120 | xfgets(line, sizeof(line), stdin); | 111 | xfgets(line, sizeof(line), stdin); |
121 | if (!tty_stdio) | ||
122 | printf("\n"); | ||
123 | return 1; | 112 | return 1; |
124 | default: | 113 | default: |
125 | break; | 114 | break; |
@@ -199,9 +188,7 @@ static int conf_sym(struct menu *menu) | |||
199 | printf("/m"); | 188 | printf("/m"); |
200 | if (oldval != yes && sym_tristate_within_range(sym, yes)) | 189 | if (oldval != yes && sym_tristate_within_range(sym, yes)) |
201 | printf("/y"); | 190 | printf("/y"); |
202 | if (menu_has_help(menu)) | 191 | printf("/?] "); |
203 | printf("/?"); | ||
204 | printf("] "); | ||
205 | if (!conf_askvalue(sym, sym_get_string_value(sym))) | 192 | if (!conf_askvalue(sym, sym_get_string_value(sym))) |
206 | return 0; | 193 | return 0; |
207 | strip(line); | 194 | strip(line); |
@@ -303,10 +290,7 @@ static int conf_choice(struct menu *menu) | |||
303 | printf("[1]: 1\n"); | 290 | printf("[1]: 1\n"); |
304 | goto conf_childs; | 291 | goto conf_childs; |
305 | } | 292 | } |
306 | printf("[1-%d", cnt); | 293 | printf("[1-%d?]: ", cnt); |
307 | if (menu_has_help(menu)) | ||
308 | printf("?"); | ||
309 | printf("]: "); | ||
310 | switch (input_mode) { | 294 | switch (input_mode) { |
311 | case oldconfig: | 295 | case oldconfig: |
312 | case silentoldconfig: | 296 | case silentoldconfig: |
@@ -315,7 +299,6 @@ static int conf_choice(struct menu *menu) | |||
315 | printf("%d\n", cnt); | 299 | printf("%d\n", cnt); |
316 | break; | 300 | break; |
317 | } | 301 | } |
318 | check_stdin(); | ||
319 | /* fall through */ | 302 | /* fall through */ |
320 | case oldaskconfig: | 303 | case oldaskconfig: |
321 | fflush(stdout); | 304 | fflush(stdout); |
@@ -508,7 +491,7 @@ int main(int ac, char **av) | |||
508 | bindtextdomain(PACKAGE, LOCALEDIR); | 491 | bindtextdomain(PACKAGE, LOCALEDIR); |
509 | textdomain(PACKAGE); | 492 | textdomain(PACKAGE); |
510 | 493 | ||
511 | tty_stdio = isatty(0) && isatty(1) && isatty(2); | 494 | tty_stdio = isatty(0) && isatty(1); |
512 | 495 | ||
513 | while ((opt = getopt_long(ac, av, "s", long_opts, NULL)) != -1) { | 496 | while ((opt = getopt_long(ac, av, "s", long_opts, NULL)) != -1) { |
514 | if (opt == 's') { | 497 | if (opt == 's') { |
@@ -565,7 +548,7 @@ int main(int ac, char **av) | |||
565 | } | 548 | } |
566 | } | 549 | } |
567 | if (ac == optind) { | 550 | if (ac == optind) { |
568 | printf(_("%s: Kconfig file missing\n"), av[0]); | 551 | fprintf(stderr, _("%s: Kconfig file missing\n"), av[0]); |
569 | conf_usage(progname); | 552 | conf_usage(progname); |
570 | exit(1); | 553 | exit(1); |
571 | } | 554 | } |
@@ -590,9 +573,11 @@ int main(int ac, char **av) | |||
590 | if (!defconfig_file) | 573 | if (!defconfig_file) |
591 | defconfig_file = conf_get_default_confname(); | 574 | defconfig_file = conf_get_default_confname(); |
592 | if (conf_read(defconfig_file)) { | 575 | if (conf_read(defconfig_file)) { |
593 | printf(_("***\n" | 576 | fprintf(stderr, |
594 | "*** Can't find default configuration \"%s\"!\n" | 577 | _("***\n" |
595 | "***\n"), defconfig_file); | 578 | "*** Can't find default configuration \"%s\"!\n" |
579 | "***\n"), | ||
580 | defconfig_file); | ||
596 | exit(1); | 581 | exit(1); |
597 | } | 582 | } |
598 | break; | 583 | break; |
@@ -650,7 +635,6 @@ int main(int ac, char **av) | |||
650 | return 1; | 635 | return 1; |
651 | } | 636 | } |
652 | } | 637 | } |
653 | valid_stdin = tty_stdio; | ||
654 | } | 638 | } |
655 | 639 | ||
656 | switch (input_mode) { | 640 | switch (input_mode) { |
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index f7927391de30..5c12dc91ef34 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c | |||
@@ -201,7 +201,7 @@ static int add_byte(int c, char **lineptr, size_t slen, size_t *n) | |||
201 | if (new_size > *n) { | 201 | if (new_size > *n) { |
202 | new_size += LINE_GROWTH - 1; | 202 | new_size += LINE_GROWTH - 1; |
203 | new_size *= 2; | 203 | new_size *= 2; |
204 | nline = realloc(*lineptr, new_size); | 204 | nline = xrealloc(*lineptr, new_size); |
205 | if (!nline) | 205 | if (!nline) |
206 | return -1; | 206 | return -1; |
207 | 207 | ||
diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c index 2ba332b3fed7..d45381986ac7 100644 --- a/scripts/kconfig/expr.c +++ b/scripts/kconfig/expr.c | |||
@@ -94,7 +94,7 @@ struct expr *expr_copy(const struct expr *org) | |||
94 | e->right.expr = expr_copy(org->right.expr); | 94 | e->right.expr = expr_copy(org->right.expr); |
95 | break; | 95 | break; |
96 | default: | 96 | default: |
97 | printf("can't copy type %d\n", e->type); | 97 | fprintf(stderr, "can't copy type %d\n", e->type); |
98 | free(e); | 98 | free(e); |
99 | e = NULL; | 99 | e = NULL; |
100 | break; | 100 | break; |
@@ -127,7 +127,7 @@ void expr_free(struct expr *e) | |||
127 | expr_free(e->right.expr); | 127 | expr_free(e->right.expr); |
128 | break; | 128 | break; |
129 | default: | 129 | default: |
130 | printf("how to free type %d?\n", e->type); | 130 | fprintf(stderr, "how to free type %d?\n", e->type); |
131 | break; | 131 | break; |
132 | } | 132 | } |
133 | free(e); | 133 | free(e); |
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index 16cb62b92650..4e23febbe4b2 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h | |||
@@ -114,6 +114,7 @@ struct file *file_lookup(const char *name); | |||
114 | int file_write_dep(const char *name); | 114 | int file_write_dep(const char *name); |
115 | void *xmalloc(size_t size); | 115 | void *xmalloc(size_t size); |
116 | void *xcalloc(size_t nmemb, size_t size); | 116 | void *xcalloc(size_t nmemb, size_t size); |
117 | void *xrealloc(void *p, size_t size); | ||
117 | 118 | ||
118 | struct gstr { | 119 | struct gstr { |
119 | size_t len; | 120 | size_t len; |
diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h index 5d86e2dfae59..9dc8abfb1dc3 100644 --- a/scripts/kconfig/lkc_proto.h +++ b/scripts/kconfig/lkc_proto.h | |||
@@ -31,7 +31,7 @@ extern struct symbol * symbol_hash[SYMBOL_HASHSIZE]; | |||
31 | 31 | ||
32 | struct symbol * sym_lookup(const char *name, int flags); | 32 | struct symbol * sym_lookup(const char *name, int flags); |
33 | struct symbol * sym_find(const char *name); | 33 | struct symbol * sym_find(const char *name); |
34 | const char * sym_expand_string_value(const char *in); | 34 | char *sym_expand_string_value(const char *in); |
35 | const char * sym_escape_string_value(const char *in); | 35 | const char * sym_escape_string_value(const char *in); |
36 | struct symbol ** sym_re_search(const char *pattern); | 36 | struct symbol ** sym_re_search(const char *pattern); |
37 | const char * sym_type_name(enum symbol_type type); | 37 | const char * sym_type_name(enum symbol_type type); |
diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c index a64b1c31253e..88874acfda36 100644 --- a/scripts/kconfig/nconf.gui.c +++ b/scripts/kconfig/nconf.gui.c | |||
@@ -6,6 +6,7 @@ | |||
6 | * | 6 | * |
7 | */ | 7 | */ |
8 | #include "nconf.h" | 8 | #include "nconf.h" |
9 | #include "lkc.h" | ||
9 | 10 | ||
10 | /* a list of all the different widgets we use */ | 11 | /* a list of all the different widgets we use */ |
11 | attributes_t attributes[ATTR_MAX+1] = {0}; | 12 | attributes_t attributes[ATTR_MAX+1] = {0}; |
@@ -374,7 +375,7 @@ int dialog_inputbox(WINDOW *main_window, | |||
374 | 375 | ||
375 | if (strlen(init)+1 > *result_len) { | 376 | if (strlen(init)+1 > *result_len) { |
376 | *result_len = strlen(init)+1; | 377 | *result_len = strlen(init)+1; |
377 | *resultp = result = realloc(result, *result_len); | 378 | *resultp = result = xrealloc(result, *result_len); |
378 | } | 379 | } |
379 | 380 | ||
380 | /* find the widest line of msg: */ | 381 | /* find the widest line of msg: */ |
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index c9123ed2b791..cca9663be5dd 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c | |||
@@ -371,11 +371,13 @@ void sym_calc_value(struct symbol *sym) | |||
371 | sym->curr.tri = no; | 371 | sym->curr.tri = no; |
372 | return; | 372 | return; |
373 | } | 373 | } |
374 | if (!sym_is_choice_value(sym)) | 374 | sym->flags &= ~SYMBOL_WRITE; |
375 | sym->flags &= ~SYMBOL_WRITE; | ||
376 | 375 | ||
377 | sym_calc_visibility(sym); | 376 | sym_calc_visibility(sym); |
378 | 377 | ||
378 | if (sym->visible != no) | ||
379 | sym->flags |= SYMBOL_WRITE; | ||
380 | |||
379 | /* set default if recursively called */ | 381 | /* set default if recursively called */ |
380 | sym->curr = newval; | 382 | sym->curr = newval; |
381 | 383 | ||
@@ -390,7 +392,6 @@ void sym_calc_value(struct symbol *sym) | |||
390 | /* if the symbol is visible use the user value | 392 | /* if the symbol is visible use the user value |
391 | * if available, otherwise try the default value | 393 | * if available, otherwise try the default value |
392 | */ | 394 | */ |
393 | sym->flags |= SYMBOL_WRITE; | ||
394 | if (sym_has_value(sym)) { | 395 | if (sym_has_value(sym)) { |
395 | newval.tri = EXPR_AND(sym->def[S_DEF_USER].tri, | 396 | newval.tri = EXPR_AND(sym->def[S_DEF_USER].tri, |
396 | sym->visible); | 397 | sym->visible); |
@@ -433,12 +434,9 @@ void sym_calc_value(struct symbol *sym) | |||
433 | case S_STRING: | 434 | case S_STRING: |
434 | case S_HEX: | 435 | case S_HEX: |
435 | case S_INT: | 436 | case S_INT: |
436 | if (sym->visible != no) { | 437 | if (sym->visible != no && sym_has_value(sym)) { |
437 | sym->flags |= SYMBOL_WRITE; | 438 | newval.val = sym->def[S_DEF_USER].val; |
438 | if (sym_has_value(sym)) { | 439 | break; |
439 | newval.val = sym->def[S_DEF_USER].val; | ||
440 | break; | ||
441 | } | ||
442 | } | 440 | } |
443 | prop = sym_get_default_prop(sym); | 441 | prop = sym_get_default_prop(sym); |
444 | if (prop) { | 442 | if (prop) { |
@@ -901,7 +899,7 @@ struct symbol *sym_find(const char *name) | |||
901 | * name to be expanded shall be prefixed by a '$'. Unknown symbol expands to | 899 | * name to be expanded shall be prefixed by a '$'. Unknown symbol expands to |
902 | * the empty string. | 900 | * the empty string. |
903 | */ | 901 | */ |
904 | const char *sym_expand_string_value(const char *in) | 902 | char *sym_expand_string_value(const char *in) |
905 | { | 903 | { |
906 | const char *src; | 904 | const char *src; |
907 | char *res; | 905 | char *res; |
@@ -938,7 +936,7 @@ const char *sym_expand_string_value(const char *in) | |||
938 | newlen = strlen(res) + strlen(symval) + strlen(src) + 1; | 936 | newlen = strlen(res) + strlen(symval) + strlen(src) + 1; |
939 | if (newlen > reslen) { | 937 | if (newlen > reslen) { |
940 | reslen = newlen; | 938 | reslen = newlen; |
941 | res = realloc(res, reslen); | 939 | res = xrealloc(res, reslen); |
942 | } | 940 | } |
943 | 941 | ||
944 | strcat(res, symval); | 942 | strcat(res, symval); |
@@ -1223,7 +1221,7 @@ static struct symbol *sym_check_expr_deps(struct expr *e) | |||
1223 | default: | 1221 | default: |
1224 | break; | 1222 | break; |
1225 | } | 1223 | } |
1226 | printf("Oops! How to check %d?\n", e->type); | 1224 | fprintf(stderr, "Oops! How to check %d?\n", e->type); |
1227 | return NULL; | 1225 | return NULL; |
1228 | } | 1226 | } |
1229 | 1227 | ||
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c index 0e76042473cc..b98a79e30e04 100644 --- a/scripts/kconfig/util.c +++ b/scripts/kconfig/util.c | |||
@@ -14,11 +14,11 @@ | |||
14 | struct file *file_lookup(const char *name) | 14 | struct file *file_lookup(const char *name) |
15 | { | 15 | { |
16 | struct file *file; | 16 | struct file *file; |
17 | const char *file_name = sym_expand_string_value(name); | 17 | char *file_name = sym_expand_string_value(name); |
18 | 18 | ||
19 | for (file = file_list; file; file = file->next) { | 19 | for (file = file_list; file; file = file->next) { |
20 | if (!strcmp(name, file->name)) { | 20 | if (!strcmp(name, file->name)) { |
21 | free((void *)file_name); | 21 | free(file_name); |
22 | return file; | 22 | return file; |
23 | } | 23 | } |
24 | } | 24 | } |
@@ -104,7 +104,7 @@ void str_append(struct gstr *gs, const char *s) | |||
104 | if (s) { | 104 | if (s) { |
105 | l = strlen(gs->s) + strlen(s) + 1; | 105 | l = strlen(gs->s) + strlen(s) + 1; |
106 | if (l > gs->len) { | 106 | if (l > gs->len) { |
107 | gs->s = realloc(gs->s, l); | 107 | gs->s = xrealloc(gs->s, l); |
108 | gs->len = l; | 108 | gs->len = l; |
109 | } | 109 | } |
110 | strcat(gs->s, s); | 110 | strcat(gs->s, s); |
@@ -145,3 +145,12 @@ void *xcalloc(size_t nmemb, size_t size) | |||
145 | fprintf(stderr, "Out of memory.\n"); | 145 | fprintf(stderr, "Out of memory.\n"); |
146 | exit(1); | 146 | exit(1); |
147 | } | 147 | } |
148 | |||
149 | void *xrealloc(void *p, size_t size) | ||
150 | { | ||
151 | p = realloc(p, size); | ||
152 | if (p) | ||
153 | return p; | ||
154 | fprintf(stderr, "Out of memory.\n"); | ||
155 | exit(1); | ||
156 | } | ||
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index 07e074dc68a1..02de6fe302a9 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l | |||
@@ -52,7 +52,7 @@ static void append_string(const char *str, int size) | |||
52 | if (new_size > text_asize) { | 52 | if (new_size > text_asize) { |
53 | new_size += START_STRSIZE - 1; | 53 | new_size += START_STRSIZE - 1; |
54 | new_size &= -START_STRSIZE; | 54 | new_size &= -START_STRSIZE; |
55 | text = realloc(text, new_size); | 55 | text = xrealloc(text, new_size); |
56 | text_asize = new_size; | 56 | text_asize = new_size; |
57 | } | 57 | } |
58 | memcpy(text + text_size, str, size); | 58 | memcpy(text + text_size, str, size); |
@@ -184,7 +184,9 @@ n [A-Za-z0-9_-] | |||
184 | append_string(yytext, 1); | 184 | append_string(yytext, 1); |
185 | } | 185 | } |
186 | \n { | 186 | \n { |
187 | printf("%s:%d:warning: multi-line strings not supported\n", zconf_curname(), zconf_lineno()); | 187 | fprintf(stderr, |
188 | "%s:%d:warning: multi-line strings not supported\n", | ||
189 | zconf_curname(), zconf_lineno()); | ||
188 | current_file->lineno++; | 190 | current_file->lineno++; |
189 | BEGIN(INITIAL); | 191 | BEGIN(INITIAL); |
190 | return T_EOL; | 192 | return T_EOL; |
@@ -294,7 +296,7 @@ void zconf_initscan(const char *name) | |||
294 | { | 296 | { |
295 | yyin = zconf_fopen(name); | 297 | yyin = zconf_fopen(name); |
296 | if (!yyin) { | 298 | if (!yyin) { |
297 | printf("can't find file %s\n", name); | 299 | fprintf(stderr, "can't find file %s\n", name); |
298 | exit(1); | 300 | exit(1); |
299 | } | 301 | } |
300 | 302 | ||
@@ -315,8 +317,8 @@ void zconf_nextfile(const char *name) | |||
315 | current_buf->state = YY_CURRENT_BUFFER; | 317 | current_buf->state = YY_CURRENT_BUFFER; |
316 | yyin = zconf_fopen(file->name); | 318 | yyin = zconf_fopen(file->name); |
317 | if (!yyin) { | 319 | if (!yyin) { |
318 | printf("%s:%d: can't open file \"%s\"\n", | 320 | fprintf(stderr, "%s:%d: can't open file \"%s\"\n", |
319 | zconf_curname(), zconf_lineno(), file->name); | 321 | zconf_curname(), zconf_lineno(), file->name); |
320 | exit(1); | 322 | exit(1); |
321 | } | 323 | } |
322 | yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE)); | 324 | yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE)); |
@@ -325,20 +327,21 @@ void zconf_nextfile(const char *name) | |||
325 | 327 | ||
326 | for (iter = current_file->parent; iter; iter = iter->parent ) { | 328 | for (iter = current_file->parent; iter; iter = iter->parent ) { |
327 | if (!strcmp(current_file->name,iter->name) ) { | 329 | if (!strcmp(current_file->name,iter->name) ) { |
328 | printf("%s:%d: recursive inclusion detected. " | 330 | fprintf(stderr, |
329 | "Inclusion path:\n current file : '%s'\n", | 331 | "%s:%d: recursive inclusion detected. " |
330 | zconf_curname(), zconf_lineno(), | 332 | "Inclusion path:\n current file : '%s'\n", |
331 | zconf_curname()); | 333 | zconf_curname(), zconf_lineno(), |
334 | zconf_curname()); | ||
332 | iter = current_file->parent; | 335 | iter = current_file->parent; |
333 | while (iter && \ | 336 | while (iter && \ |
334 | strcmp(iter->name,current_file->name)) { | 337 | strcmp(iter->name,current_file->name)) { |
335 | printf(" included from: '%s:%d'\n", | 338 | fprintf(stderr, " included from: '%s:%d'\n", |
336 | iter->name, iter->lineno-1); | 339 | iter->name, iter->lineno-1); |
337 | iter = iter->parent; | 340 | iter = iter->parent; |
338 | } | 341 | } |
339 | if (iter) | 342 | if (iter) |
340 | printf(" included from: '%s:%d'\n", | 343 | fprintf(stderr, " included from: '%s:%d'\n", |
341 | iter->name, iter->lineno+1); | 344 | iter->name, iter->lineno+1); |
342 | exit(1); | 345 | exit(1); |
343 | } | 346 | } |
344 | } | 347 | } |
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 21ce883e5d9e..4be98050b961 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y | |||
@@ -436,6 +436,12 @@ help: help_start T_HELPTEXT | |||
436 | zconfprint("warning: '%s' defined with more than one help text -- only the last one will be used", | 436 | zconfprint("warning: '%s' defined with more than one help text -- only the last one will be used", |
437 | current_entry->sym->name ?: "<choice>"); | 437 | current_entry->sym->name ?: "<choice>"); |
438 | } | 438 | } |
439 | |||
440 | /* Is the help text empty or all whitespace? */ | ||
441 | if ($2[strspn($2, " \f\n\r\t\v")] == '\0') | ||
442 | zconfprint("warning: '%s' defined with blank help text", | ||
443 | current_entry->sym->name ?: "<choice>"); | ||
444 | |||
439 | current_entry->help = $2; | 445 | current_entry->help = $2; |
440 | }; | 446 | }; |
441 | 447 | ||