Skip to content

Commit

Permalink
fixdep: remove some false CONFIG_ matches
Browse files Browse the repository at this point in the history
The string CONFIG_ quite often appears after other alphanumerics,
meaning that that instance cannot be referencing a Kconfig
symbol. Omitting these means make has fewer files to stat() when
deciding what needs to be rebuilt - for a defconfig build, this seems to
remove about 2% of the (wildcard ...) lines from the .o.cmd files.

Signed-off-by: Rasmus Villemoes <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
Villemoes authored and masahir0y committed Mar 5, 2018
1 parent 14a596a commit 5b8ad96
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/basic/fixdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,13 @@ static int str_ends_with(const char *s, int slen, const char *sub)
static void parse_config_file(const char *p)
{
const char *q, *r;
const char *start = p;

while ((p = strstr(p, "CONFIG_"))) {
if (p > start && (isalnum(p[-1]) || p[-1] == '_')) {
p += 7;
continue;
}
p += 7;
q = p;
while (*q && (isalnum(*q) || *q == '_'))
Expand Down

0 comments on commit 5b8ad96

Please sign in to comment.