Skip to content

Commit d721109

Browse files
masahir0yMichal Marek
authored andcommitted
kbuild: fixdep: optimize code slightly
If the target string matches "CONFIG_", move the pointer p forward. This saves several 7-chars adjustments. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Michal Marek <mmarek@suse.com>
1 parent 5b733fa commit d721109

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎scripts/basic/fixdep.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ static void parse_config_file(const char *map, size_t len)
251251
continue;
252252
if (memcmp(p, "CONFIG_", 7))
253253
continue;
254-
for (q = p + 7; q < map + len; q++) {
254+
p += 7;
255+
for (q = p; q < map + len; q++) {
255256
if (!(isalnum(*q) || *q == '_'))
256257
goto found;
257258
}
@@ -260,9 +261,9 @@ static void parse_config_file(const char *map, size_t len)
260261
found:
261262
if (!memcmp(q - 7, "_MODULE", 7))
262263
q -= 7;
263-
if( (q-p-7) < 0 )
264+
if (q - p < 0)
264265
continue;
265-
use_config(p+7, q-p-7);
266+
use_config(p, q - p);
266267
}
267268
}
268269

0 commit comments

Comments
 (0)