summaryrefslogtreecommitdiff
path: root/backport/kconf/confdata.c
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2019-08-03 23:11:03 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2019-08-14 20:15:48 +0200
commit4ec72687181df4b786152747c008a688c9b9b9de (patch)
treee6d4ed3374ad6d933720affb5bf3d5b6465339f1 /backport/kconf/confdata.c
parent02a404089c8dc993293a675255b5aad6bb21bf67 (diff)
kconfig: Update to KConfig to version from kernel 4.17
This updates the KConfig system used in backports to the version from kernel 4.17. In kernel 4.18 some bigger changes to the KConfig system were introduced which are harder to backport, so start with using this older version. This version now generates the zconf.lex.c and zconf.tab.c files from the original sources, newer kernel versions will delete these files in a make clean, after that they are now regenerated. We do not ship them by default any more, so we need lex and yacc. The Makefile was not copied from the mainline kernel but this is written specifically for the backports project. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Cc: Anthony Wong <yp@anthonywong.net>
Diffstat (limited to 'backport/kconf/confdata.c')
-rw-r--r--backport/kconf/confdata.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/backport/kconf/confdata.c b/backport/kconf/confdata.c
index 297b079a..df26c7b0 100644
--- a/backport/kconf/confdata.c
+++ b/backport/kconf/confdata.c
@@ -28,7 +28,7 @@ static void conf_message(const char *fmt, ...)
__attribute__ ((format (printf, 1, 2)));
static const char *conf_filename;
-static int conf_lineno, conf_warnings, conf_unsaved;
+static int conf_lineno, conf_warnings;
const char conf_defname[] = "arch/$ARCH/defconfig";
@@ -178,7 +178,7 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
case S_HEX:
done:
if (sym_string_valid(sym, p)) {
- sym->def[def].val = strdup(p);
+ sym->def[def].val = xstrdup(p);
sym->flags |= def_flags;
} else {
if (def != S_DEF_AUTO)
@@ -201,7 +201,7 @@ static int add_byte(int c, char **lineptr, size_t slen, size_t *n)
if (new_size > *n) {
new_size += LINE_GROWTH - 1;
new_size *= 2;
- nline = realloc(*lineptr, new_size);
+ nline = xrealloc(*lineptr, new_size);
if (!nline)
return -1;
@@ -290,7 +290,6 @@ load:
conf_filename = name;
conf_lineno = 0;
conf_warnings = 0;
- conf_unsaved = 0;
def_flags = SYMBOL_DEF << def;
for_all_symbols(i, sym) {
@@ -409,6 +408,7 @@ setsym:
int conf_read(const char *name)
{
struct symbol *sym;
+ int conf_unsaved = 0;
int i;
sym_set_change_count(0);
@@ -1123,7 +1123,7 @@ void set_all_choice_values(struct symbol *csym)
bool conf_set_all_new_symbols(enum conf_def_mode mode)
{
struct symbol *sym, *csym;
- int i, cnt, pby, pty, ptm; /* pby: probability of boolean = y
+ int i, cnt, pby, pty, ptm; /* pby: probability of bool = y
* pty: probability of tristate = y
* ptm: probability of tristate = m
*/