summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/basic/fixdep.c30
-rw-r--r--scripts/kconfig/confdata.c20
2 files changed, 27 insertions, 23 deletions
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index 811d48b..6d61044 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -225,32 +225,36 @@ void use_config(char *m, int slen)
void parse_config_file(char *map, size_t len)
{
/* modified for bbox */
- char *end_4 = map + len - 4; /* 4 == length of "USE_" */
+ char *end_3 = map + len - 3; /* 3 == length of "IF_" */
char *end_7 = map + len - 7;
char *p = map;
char *q;
int off;
- for (; p < end_4; p++) {
+ for (; p <= end_3; p++) {
+ /* Find next identifier's beginning */
+ if (!(isalnum(*p) || *p == '_'))
+ continue;
+
+ /* Check it */
if (p < end_7 && p[6] == '_') {
if (!memcmp(p, "CONFIG", 6)) goto conf7;
if (!memcmp(p, "ENABLE", 6)) goto conf7;
+ if (!memcmp(p, "IF_NOT", 6)) goto conf7;
}
- /* We have at least 5 chars: for() has
- * "p < end-4", not "p <= end-4"
- * therefore we don't need to check p <= end-5 here */
- if (p[4] == '_')
- if (!memcmp(p, "SKIP", 4)) goto conf5;
- /* Ehhh, gcc is too stupid to just compare it as 32bit int */
- if (p[0] == 'U')
- if (!memcmp(p, "USE_", 4)) goto conf4;
+ /* we have at least 3 chars because of p <= end_3 */
+ /*if (!memcmp(p, "IF_", 3)) goto conf3;*/
+ if (p[0] == 'I' && p[1] == 'F' && p[2] == '_') goto conf3;
+
+ /* This identifier is not interesting, skip it */
+ while (p <= end_3 && (isalnum(*p) || *p == '_'))
+ p++;
continue;
- conf4: off = 4;
- conf5: off = 5;
+ conf3: off = 3;
conf7: off = 7;
p += off;
- for (q = p; q < end_4+4; q++) {
+ for (q = p; q < end_3+3; q++) {
if (!(isalnum(*q) || *q == '_'))
break;
}
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 58ea96d..9365a12 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -458,8 +458,8 @@ int conf_write(const char *name)
fprintf(out_h, "#undef CONFIG_%s\n", sym->name);
/* bbox */
fprintf(out_h, "#define ENABLE_%s 0\n", sym->name);
- fprintf(out_h, "#define USE_%s(...)\n", sym->name);
- fprintf(out_h, "#define SKIP_%s(...) __VA_ARGS__\n", sym->name);
+ fprintf(out_h, "#define IF_%s(...)\n", sym->name);
+ fprintf(out_h, "#define IF_NOT_%s(...) __VA_ARGS__\n", sym->name);
}
break;
case mod:
@@ -473,8 +473,8 @@ int conf_write(const char *name)
fprintf(out_h, "#define CONFIG_%s 1\n", sym->name);
/* bbox */
fprintf(out_h, "#define ENABLE_%s 1\n", sym->name);
- fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", sym->name);
- fprintf(out_h, "#define SKIP_%s(...)\n", sym->name);
+ fprintf(out_h, "#define IF_%s(...) __VA_ARGS__\n", sym->name);
+ fprintf(out_h, "#define IF_NOT_%s(...)\n", sym->name);
}
break;
}
@@ -505,8 +505,8 @@ int conf_write(const char *name)
fputs("\"\n", out_h);
/* bbox */
fprintf(out_h, "#define ENABLE_%s 1\n", sym->name);
- fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", sym->name);
- fprintf(out_h, "#define SKIP_%s(...)\n", sym->name);
+ fprintf(out_h, "#define IF_%s(...) __VA_ARGS__\n", sym->name);
+ fprintf(out_h, "#define IF_NOT_%s(...)\n", sym->name);
}
break;
case S_HEX:
@@ -517,8 +517,8 @@ int conf_write(const char *name)
fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str);
/* bbox */
fprintf(out_h, "#define ENABLE_%s 1\n", sym->name);
- fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", sym->name);
- fprintf(out_h, "#define SKIP_%s(...)\n", sym->name);
+ fprintf(out_h, "#define IF_%s(...) __VA_ARGS__\n", sym->name);
+ fprintf(out_h, "#define IF_NOT_%s(...)\n", sym->name);
}
break;
}
@@ -531,8 +531,8 @@ int conf_write(const char *name)
fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str);
/* bbox */
fprintf(out_h, "#define ENABLE_%s 1\n", sym->name);
- fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", sym->name);
- fprintf(out_h, "#define SKIP_%s(...)\n", sym->name);
+ fprintf(out_h, "#define IF_%s(...) __VA_ARGS__\n", sym->name);
+ fprintf(out_h, "#define IF_NOT_%s(...)\n", sym->name);
}
break;
}