From 9012d79cf0c760eb69d54163ee5152c1b504f7aa Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 15 Sep 2021 09:00:02 +0200 Subject: 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 Signed-off-by: Gabriel Krisman Bertazi --- fs/unicode/utf8-selftest.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'fs/unicode/utf8-selftest.c') diff --git a/fs/unicode/utf8-selftest.c b/fs/unicode/utf8-selftest.c index 37f33890e012..80fb7c75acb2 100644 --- a/fs/unicode/utf8-selftest.c +++ b/fs/unicode/utf8-selftest.c @@ -160,6 +160,11 @@ static const struct { } }; +static ssize_t utf8len(const struct utf8data *data, const char *s) +{ + return utf8nlen(data, s, (size_t)-1); +} + static void check_utf8_nfdi(void) { int i; -- cgit v1.2.3