diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/basic/fixdep.c | 30 | ||||
-rw-r--r-- | scripts/kconfig/confdata.c | 20 |
2 files changed, 27 insertions, 23 deletions
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 811d48b78..6d61044c4 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c | |||
@@ -225,32 +225,36 @@ void use_config(char *m, int slen) | |||
225 | void parse_config_file(char *map, size_t len) | 225 | void parse_config_file(char *map, size_t len) |
226 | { | 226 | { |
227 | /* modified for bbox */ | 227 | /* modified for bbox */ |
228 | char *end_4 = map + len - 4; /* 4 == length of "USE_" */ | 228 | char *end_3 = map + len - 3; /* 3 == length of "IF_" */ |
229 | char *end_7 = map + len - 7; | 229 | char *end_7 = map + len - 7; |
230 | char *p = map; | 230 | char *p = map; |
231 | char *q; | 231 | char *q; |
232 | int off; | 232 | int off; |
233 | 233 | ||
234 | for (; p < end_4; p++) { | 234 | for (; p <= end_3; p++) { |
235 | /* Find next identifier's beginning */ | ||
236 | if (!(isalnum(*p) || *p == '_')) | ||
237 | continue; | ||
238 | |||
239 | /* Check it */ | ||
235 | if (p < end_7 && p[6] == '_') { | 240 | if (p < end_7 && p[6] == '_') { |
236 | if (!memcmp(p, "CONFIG", 6)) goto conf7; | 241 | if (!memcmp(p, "CONFIG", 6)) goto conf7; |
237 | if (!memcmp(p, "ENABLE", 6)) goto conf7; | 242 | if (!memcmp(p, "ENABLE", 6)) goto conf7; |
243 | if (!memcmp(p, "IF_NOT", 6)) goto conf7; | ||
238 | } | 244 | } |
239 | /* We have at least 5 chars: for() has | 245 | /* we have at least 3 chars because of p <= end_3 */ |
240 | * "p < end-4", not "p <= end-4" | 246 | /*if (!memcmp(p, "IF_", 3)) goto conf3;*/ |
241 | * therefore we don't need to check p <= end-5 here */ | 247 | if (p[0] == 'I' && p[1] == 'F' && p[2] == '_') goto conf3; |
242 | if (p[4] == '_') | 248 | |
243 | if (!memcmp(p, "SKIP", 4)) goto conf5; | 249 | /* This identifier is not interesting, skip it */ |
244 | /* Ehhh, gcc is too stupid to just compare it as 32bit int */ | 250 | while (p <= end_3 && (isalnum(*p) || *p == '_')) |
245 | if (p[0] == 'U') | 251 | p++; |
246 | if (!memcmp(p, "USE_", 4)) goto conf4; | ||
247 | continue; | 252 | continue; |
248 | 253 | ||
249 | conf4: off = 4; | 254 | conf3: off = 3; |
250 | conf5: off = 5; | ||
251 | conf7: off = 7; | 255 | conf7: off = 7; |
252 | p += off; | 256 | p += off; |
253 | for (q = p; q < end_4+4; q++) { | 257 | for (q = p; q < end_3+3; q++) { |
254 | if (!(isalnum(*q) || *q == '_')) | 258 | if (!(isalnum(*q) || *q == '_')) |
255 | break; | 259 | break; |
256 | } | 260 | } |
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 58ea96d5c..9365a12c2 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c | |||
@@ -458,8 +458,8 @@ int conf_write(const char *name) | |||
458 | fprintf(out_h, "#undef CONFIG_%s\n", sym->name); | 458 | fprintf(out_h, "#undef CONFIG_%s\n", sym->name); |
459 | /* bbox */ | 459 | /* bbox */ |
460 | fprintf(out_h, "#define ENABLE_%s 0\n", sym->name); | 460 | fprintf(out_h, "#define ENABLE_%s 0\n", sym->name); |
461 | fprintf(out_h, "#define USE_%s(...)\n", sym->name); | 461 | fprintf(out_h, "#define IF_%s(...)\n", sym->name); |
462 | fprintf(out_h, "#define SKIP_%s(...) __VA_ARGS__\n", sym->name); | 462 | fprintf(out_h, "#define IF_NOT_%s(...) __VA_ARGS__\n", sym->name); |
463 | } | 463 | } |
464 | break; | 464 | break; |
465 | case mod: | 465 | case mod: |
@@ -473,8 +473,8 @@ int conf_write(const char *name) | |||
473 | fprintf(out_h, "#define CONFIG_%s 1\n", sym->name); | 473 | fprintf(out_h, "#define CONFIG_%s 1\n", sym->name); |
474 | /* bbox */ | 474 | /* bbox */ |
475 | fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); | 475 | fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); |
476 | fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", sym->name); | 476 | fprintf(out_h, "#define IF_%s(...) __VA_ARGS__\n", sym->name); |
477 | fprintf(out_h, "#define SKIP_%s(...)\n", sym->name); | 477 | fprintf(out_h, "#define IF_NOT_%s(...)\n", sym->name); |
478 | } | 478 | } |
479 | break; | 479 | break; |
480 | } | 480 | } |
@@ -505,8 +505,8 @@ int conf_write(const char *name) | |||
505 | fputs("\"\n", out_h); | 505 | fputs("\"\n", out_h); |
506 | /* bbox */ | 506 | /* bbox */ |
507 | fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); | 507 | fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); |
508 | fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", sym->name); | 508 | fprintf(out_h, "#define IF_%s(...) __VA_ARGS__\n", sym->name); |
509 | fprintf(out_h, "#define SKIP_%s(...)\n", sym->name); | 509 | fprintf(out_h, "#define IF_NOT_%s(...)\n", sym->name); |
510 | } | 510 | } |
511 | break; | 511 | break; |
512 | case S_HEX: | 512 | case S_HEX: |
@@ -517,8 +517,8 @@ int conf_write(const char *name) | |||
517 | fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str); | 517 | fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str); |
518 | /* bbox */ | 518 | /* bbox */ |
519 | fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); | 519 | fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); |
520 | fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", sym->name); | 520 | fprintf(out_h, "#define IF_%s(...) __VA_ARGS__\n", sym->name); |
521 | fprintf(out_h, "#define SKIP_%s(...)\n", sym->name); | 521 | fprintf(out_h, "#define IF_NOT_%s(...)\n", sym->name); |
522 | } | 522 | } |
523 | break; | 523 | break; |
524 | } | 524 | } |
@@ -531,8 +531,8 @@ int conf_write(const char *name) | |||
531 | fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str); | 531 | fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str); |
532 | /* bbox */ | 532 | /* bbox */ |
533 | fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); | 533 | fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); |
534 | fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", sym->name); | 534 | fprintf(out_h, "#define IF_%s(...) __VA_ARGS__\n", sym->name); |
535 | fprintf(out_h, "#define SKIP_%s(...)\n", sym->name); | 535 | fprintf(out_h, "#define IF_NOT_%s(...)\n", sym->name); |
536 | } | 536 | } |
537 | break; | 537 | break; |
538 | } | 538 | } |