]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
kbuild: fixdep: optimize code slightly
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 11 Aug 2015 22:31:41 +0000 (07:31 +0900)
committerTom Rini <trini@konsulko.com>
Tue, 18 Aug 2015 17:45:59 +0000 (13:45 -0400)
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>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
scripts/basic/fixdep.c

index b30406860b7397881e4e6ffeedcda1f5b2959cc0..46cc1b3e5de2fb3a3c4391f9276a1d8cf6a7c182 100644 (file)
@@ -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;
                }
@@ -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);
        }
 }