From 334b427e96d10f6e07117a785636dac81c430141 Mon Sep 17 00:00:00 2001 From: Krzysztof Wilczynski Date: Fri, 30 Aug 2019 15:13:49 +0200 Subject: unicode: Move static keyword to the front of declarations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the static keyword to the front of declarations of nfdi_test_data and nfdicf_test_data, and resolve the following compiler warnings that can be seen when building with warnings enabled (W=1): fs/unicode/utf8-selftest.c:38:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration] fs/unicode/utf8-selftest.c:92:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration] Signed-off-by: Krzysztof Wilczynski Signed-off-by: Gabriel Krisman Bertazi --- fs/unicode/utf8-selftest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fs') diff --git a/fs/unicode/utf8-selftest.c b/fs/unicode/utf8-selftest.c index 6c1a36bbf6ad..6fe8af7edccb 100644 --- a/fs/unicode/utf8-selftest.c +++ b/fs/unicode/utf8-selftest.c @@ -35,7 +35,7 @@ unsigned int total_tests; #define test_f(cond, fmt, ...) _test(cond, __func__, __LINE__, fmt, ##__VA_ARGS__) #define test(cond) _test(cond, __func__, __LINE__, "") -const static struct { +static const struct { /* UTF-8 strings in this vector _must_ be NULL-terminated. */ unsigned char str[10]; unsigned char dec[10]; @@ -89,7 +89,7 @@ const static struct { }; -const static struct { +static const struct { /* UTF-8 strings in this vector _must_ be NULL-terminated. */ unsigned char str[30]; unsigned char ncf[30]; -- cgit v1.2.3 From aa28b98d6dbcdb1c822b53f90e509565dfc450b0 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Fri, 6 Sep 2019 14:58:07 +0100 Subject: 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 --- fs/unicode/utf8-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs') diff --git a/fs/unicode/utf8-core.c b/fs/unicode/utf8-core.c index 71ca4d047d65..2a878b739115 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} }; -- cgit v1.2.3