From: Colin Ian King Date: Fri, 6 Sep 2019 13:58:07 +0000 (+0100) Subject: unicode: make array 'token' static const, makes object smaller X-Git-Tag: v5.4-rc1~84^2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa28b98d6dbcdb1c822b53f90e509565dfc450b0;p=thirdparty%2Fkernel%2Flinux.git unicode: make array 'token' static const, makes object smaller Don't populate the array 'token' on the stack but instead make it static const. Makes the object code smaller by 234 bytes. Before: text data bss dec hex filename 5371 272 0 5643 160b fs/unicode/utf8-core.o After: text data bss dec hex filename 5041 368 0 5409 1521 fs/unicode/utf8-core.o (gcc version 9.2.1, amd64) Signed-off-by: Colin Ian King Reviewed-by: Theodore Ts'o Signed-off-by: Gabriel Krisman Bertazi --- diff --git a/fs/unicode/utf8-core.c b/fs/unicode/utf8-core.c index 71ca4d047d654..2a878b739115d 100644 --- a/fs/unicode/utf8-core.c +++ b/fs/unicode/utf8-core.c @@ -154,7 +154,7 @@ static int utf8_parse_version(const char *version, unsigned int *maj, { substring_t args[3]; char version_string[12]; - const struct match_token token[] = { + static const struct match_token token[] = { {1, "%d.%d.%d"}, {0, NULL} };