* [PATCH] utf8: Remove unused utf8_normalize
@ 2025-06-09 1:19 linux
2025-06-09 19:01 ` Gabriel Krisman Bertazi
0 siblings, 1 reply; 2+ messages in thread
From: linux @ 2025-06-09 1:19 UTC (permalink / raw)
To: krisman, linux-fsdevel; +Cc: linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
utf8_normalize() was added in 2019 as part of
commit 9d53690f0d4e ("unicode: implement higher level API for string
handling")
but has remained unused.
(I think because the other higher level routines added by that patch
normalise as part of their operations)
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
fs/unicode/utf8-core.c | 22 ----------------------
include/linux/unicode.h | 3 ---
2 files changed, 25 deletions(-)
diff --git a/fs/unicode/utf8-core.c b/fs/unicode/utf8-core.c
index 6fc9ab8667e6..1a30447c4743 100644
--- a/fs/unicode/utf8-core.c
+++ b/fs/unicode/utf8-core.c
@@ -138,28 +138,6 @@ int utf8_casefold_hash(const struct unicode_map *um, const void *salt,
}
EXPORT_SYMBOL(utf8_casefold_hash);
-int utf8_normalize(const struct unicode_map *um, const struct qstr *str,
- unsigned char *dest, size_t dlen)
-{
- struct utf8cursor cur;
- ssize_t nlen = 0;
-
- if (utf8ncursor(&cur, um, UTF8_NFDI, str->name, str->len) < 0)
- return -EINVAL;
-
- for (nlen = 0; nlen < dlen; nlen++) {
- int c = utf8byte(&cur);
-
- dest[nlen] = c;
- if (!c)
- return nlen;
- if (c == -1)
- break;
- }
- return -EINVAL;
-}
-EXPORT_SYMBOL(utf8_normalize);
-
static const struct utf8data *find_table_version(const struct utf8data *table,
size_t nr_entries, unsigned int version)
{
diff --git a/include/linux/unicode.h b/include/linux/unicode.h
index 5e6b212a2aed..64fa44fe180c 100644
--- a/include/linux/unicode.h
+++ b/include/linux/unicode.h
@@ -66,9 +66,6 @@ int utf8_strncasecmp_folded(const struct unicode_map *um,
const struct qstr *cf,
const struct qstr *s1);
-int utf8_normalize(const struct unicode_map *um, const struct qstr *str,
- unsigned char *dest, size_t dlen);
-
int utf8_casefold(const struct unicode_map *um, const struct qstr *str,
unsigned char *dest, size_t dlen);
--
2.49.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] utf8: Remove unused utf8_normalize
2025-06-09 1:19 [PATCH] utf8: Remove unused utf8_normalize linux
@ 2025-06-09 19:01 ` Gabriel Krisman Bertazi
0 siblings, 0 replies; 2+ messages in thread
From: Gabriel Krisman Bertazi @ 2025-06-09 19:01 UTC (permalink / raw)
To: linux; +Cc: linux-fsdevel, linux-kernel
linux@treblig.org writes:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> utf8_normalize() was added in 2019 as part of
> commit 9d53690f0d4e ("unicode: implement higher level API for string
> handling")
> but has remained unused.
FWIW, the original implementation made use of it, but the
normalization-only support was rightfully dropped before merging. Then,
there was an intention to enable it later but it never materialized. It
clearly can go away.
> (I think because the other higher level routines added by that patch
> normalise as part of their operations)
Correct.
I'll queue it for next.
Thank you,
--
Gabriel Krisman Bertazi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-09 19:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-09 1:19 [PATCH] utf8: Remove unused utf8_normalize linux
2025-06-09 19:01 ` Gabriel Krisman Bertazi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).