Skip to content

Commit

Permalink
kbuild: fixdep: optimize code slightly
Browse files Browse the repository at this point in the history
If the target string matches "CONFIG_", move the pointer p
forward.  This saves several 7-chars adjustments.

Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
masahir0y authored and Michal Marek committed Aug 24, 2015
1 parent 5b733fa commit d721109
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/basic/fixdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ static void parse_config_file(const char *map, size_t len)
continue;
if (memcmp(p, "CONFIG_", 7))
continue;
for (q = p + 7; q < map + len; q++) {
p += 7;
for (q = p; q < map + len; q++) {
if (!(isalnum(*q) || *q == '_'))
goto found;
}
Expand All @@ -260,9 +261,9 @@ static void parse_config_file(const char *map, size_t len)
found:
if (!memcmp(q - 7, "_MODULE", 7))
q -= 7;
if( (q-p-7) < 0 )
if (q - p < 0)
continue;
use_config(p+7, q-p-7);
use_config(p, q - p);
}
}

Expand Down

0 comments on commit d721109

Please sign in to comment.