summaryrefslogtreecommitdiffstats
path: root/fs/unicode/utf8-selftest.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-09-15 09:00:00 +0200
committerGabriel Krisman Bertazi <krisman@collabora.com>2021-10-11 17:01:46 -0300
commit49bd03cc7e95cb78420305ca2f5ef67497b6fa80 (patch)
tree5fb64ae823accadc746d0e16dc290c8c4baa3cf8 /fs/unicode/utf8-selftest.c
parentf3a9c82396006a5664f6e398d6928799d29de76e (diff)
downloadlinux-stable-49bd03cc7e95cb78420305ca2f5ef67497b6fa80.tar.gz
linux-stable-49bd03cc7e95cb78420305ca2f5ef67497b6fa80.tar.bz2
linux-stable-49bd03cc7e95cb78420305ca2f5ef67497b6fa80.zip
unicode: pass a UNICODE_AGE() tripple to utf8_load
Don't bother with pointless string parsing when the caller can just pass the version in the format that the core expects. Also remove the fallback to the latest version that none of the callers actually uses. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Diffstat (limited to 'fs/unicode/utf8-selftest.c')
-rw-r--r--fs/unicode/utf8-selftest.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/unicode/utf8-selftest.c b/fs/unicode/utf8-selftest.c
index 6fe8af7edccb..37f33890e012 100644
--- a/fs/unicode/utf8-selftest.c
+++ b/fs/unicode/utf8-selftest.c
@@ -235,7 +235,7 @@ static void check_utf8_nfdicf(void)
static void check_utf8_comparisons(void)
{
int i;
- struct unicode_map *table = utf8_load("12.1.0");
+ struct unicode_map *table = utf8_load(UNICODE_AGE(12, 1, 0));
if (IS_ERR(table)) {
pr_err("%s: Unable to load utf8 %d.%d.%d. Skipping.\n",
@@ -269,18 +269,19 @@ static void check_utf8_comparisons(void)
static void check_supported_versions(void)
{
/* Unicode 7.0.0 should be supported. */
- test(utf8version_is_supported(7, 0, 0));
+ test(utf8version_is_supported(UNICODE_AGE(7, 0, 0)));
/* Unicode 9.0.0 should be supported. */
- test(utf8version_is_supported(9, 0, 0));
+ test(utf8version_is_supported(UNICODE_AGE(9, 0, 0)));
/* Unicode 1x.0.0 (the latest version) should be supported. */
- test(utf8version_is_supported(latest_maj, latest_min, latest_rev));
+ test(utf8version_is_supported(
+ UNICODE_AGE(latest_maj, latest_min, latest_rev)));
/* Next versions don't exist. */
- test(!utf8version_is_supported(13, 0, 0));
- test(!utf8version_is_supported(0, 0, 0));
- test(!utf8version_is_supported(-1, -1, -1));
+ test(!utf8version_is_supported(UNICODE_AGE(13, 0, 0)));
+ test(!utf8version_is_supported(UNICODE_AGE(0, 0, 0)));
+ test(!utf8version_is_supported(UNICODE_AGE(-1, -1, -1)));
}
static int __init init_test_ucd(void)