e2a58d2d | 15-Sep-2021 |
Christoph Hellwig <hch@lst.de> |
unicode: only export internal symbols for the selftests
The exported symbols in utf8-norm.c are not needed for normal file system consumers, so move them to conditional _GPL exports just for the sel
unicode: only export internal symbols for the selftests
The exported symbols in utf8-norm.c are not needed for normal file system consumers, so move them to conditional _GPL exports just for the selftest.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
show more ...
|
6ca99ce7 | 15-Sep-2021 |
Christoph Hellwig <hch@lst.de> |
unicode: cache the normalization tables in struct unicode_map
Instead of repeatedly looking up the version add pointers to the NFD and NFD+CF tables to struct unicode_map, and pass a unicode_map plu
unicode: cache the normalization tables in struct unicode_map
Instead of repeatedly looking up the version add pointers to the NFD and NFD+CF tables to struct unicode_map, and pass a unicode_map plus index to the functions using the normalization tables.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
show more ...
|
fbc59d65 | 15-Sep-2021 |
Christoph Hellwig <hch@lst.de> |
unicode: move utf8cursor to utf8-selftest.c
Only used by the tests, so no need to keep it in the core.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Gabriel Krisman Bertazi <krisman@
unicode: move utf8cursor to utf8-selftest.c
Only used by the tests, so no need to keep it in the core.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
show more ...
|
9012d79c | 15-Sep-2021 |
Christoph Hellwig <hch@lst.de> |
unicode: simplify utf8len
Just use the utf8nlen implementation with a (size_t)-1 len argument, similar to utf8_lookup. Also move the function to utf8-selftest.c, as it isn't used anywhere else.
Si
unicode: simplify utf8len
Just use the utf8nlen implementation with a (size_t)-1 len argument, similar to utf8_lookup. Also move the function to utf8-selftest.c, as it isn't used anywhere else.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
show more ...
|
379210db | 15-Sep-2021 |
Christoph Hellwig <hch@lst.de> |
unicode: remove the unused utf8{,n}age{min,max} functions
No actually used anywhere.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> |
aa28b98d | 06-Sep-2019 |
Colin Ian King <colin.king@canonical.com> |
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:
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 <colin.king@canonical.com> Reviewed-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
show more ...
|
28ba53c0 | 28-Apr-2019 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
unicode: refactor the rule for regenerating utf8data.h
scripts/mkutf8data is used only when regenerating utf8data.h, which never happens in the normal kernel build. However, it is irrespectively bui
unicode: refactor the rule for regenerating utf8data.h
scripts/mkutf8data is used only when regenerating utf8data.h, which never happens in the normal kernel build. However, it is irrespectively built if CONFIG_UNICODE is enabled.
Moreover, there is no good reason for it to reside in the scripts/ directory since it is only used in fs/unicode/.
Hence, move it from scripts/ to fs/unicode/.
In some cases, we bypass build artifacts in the normal build. The conventional way to do so is to surround the code with ifdef REGENERATE_*.
For example,
- 7373f4f83c71 ("kbuild: add implicit rules for parser generation") - 6aaf49b495b4 ("crypto: arm,arm64 - Fix random regeneration of S_shipped")
I rewrote the rule in a more kbuild'ish style.
In the normal build, utf8data.h is just shipped from the check-in file.
$ make [ snip ] SHIPPED fs/unicode/utf8data.h CC fs/unicode/utf8-norm.o CC fs/unicode/utf8-core.o CC fs/unicode/utf8-selftest.o AR fs/unicode/built-in.a
If you want to generate utf8data.h based on UCD, put *.txt files into fs/unicode/, then pass REGENERATE_UTF8DATA=1 from the command line. The mkutf8data tool will be automatically compiled to generate the utf8data.h from the *.txt files.
$ make REGENERATE_UTF8DATA=1 [ snip ] HOSTCC fs/unicode/mkutf8data GEN fs/unicode/utf8data.h CC fs/unicode/utf8-norm.o CC fs/unicode/utf8-core.o CC fs/unicode/utf8-selftest.o AR fs/unicode/built-in.a
I renamed the check-in utf8data.h to utf8data.h_shipped so that this will work for the out-of-tree build.
You can update it based on the latest UCD like this:
$ make REGENERATE_UTF8DATA=1 fs/unicode/ $ cp fs/unicode/utf8data.h fs/unicode/utf8data.h_shipped
Also, I added entries to .gitignore and dontdiff.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
show more ...
|