Skip to content

Commit 379210d

Browse files
Christoph Hellwigkrisman-at-collabora
authored andcommitted
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>
1 parent 49bd03c commit 379210d

File tree

2 files changed

+0
-129
lines changed

2 files changed

+0
-129
lines changed

fs/unicode/utf8-norm.c

Lines changed: 0 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -391,119 +391,6 @@ static utf8leaf_t *utf8lookup(const struct utf8data *data,
391391
return utf8nlookup(data, hangul, s, (size_t)-1);
392392
}
393393

394-
/*
395-
* Maximum age of any character in s.
396-
* Return -1 if s is not valid UTF-8 unicode.
397-
* Return 0 if only non-assigned code points are used.
398-
*/
399-
int utf8agemax(const struct utf8data *data, const char *s)
400-
{
401-
utf8leaf_t *leaf;
402-
int age = 0;
403-
int leaf_age;
404-
unsigned char hangul[UTF8HANGULLEAF];
405-
406-
if (!data)
407-
return -1;
408-
409-
while (*s) {
410-
leaf = utf8lookup(data, hangul, s);
411-
if (!leaf)
412-
return -1;
413-
414-
leaf_age = utf8agetab[LEAF_GEN(leaf)];
415-
if (leaf_age <= data->maxage && leaf_age > age)
416-
age = leaf_age;
417-
s += utf8clen(s);
418-
}
419-
return age;
420-
}
421-
EXPORT_SYMBOL(utf8agemax);
422-
423-
/*
424-
* Minimum age of any character in s.
425-
* Return -1 if s is not valid UTF-8 unicode.
426-
* Return 0 if non-assigned code points are used.
427-
*/
428-
int utf8agemin(const struct utf8data *data, const char *s)
429-
{
430-
utf8leaf_t *leaf;
431-
int age;
432-
int leaf_age;
433-
unsigned char hangul[UTF8HANGULLEAF];
434-
435-
if (!data)
436-
return -1;
437-
age = data->maxage;
438-
while (*s) {
439-
leaf = utf8lookup(data, hangul, s);
440-
if (!leaf)
441-
return -1;
442-
leaf_age = utf8agetab[LEAF_GEN(leaf)];
443-
if (leaf_age <= data->maxage && leaf_age < age)
444-
age = leaf_age;
445-
s += utf8clen(s);
446-
}
447-
return age;
448-
}
449-
EXPORT_SYMBOL(utf8agemin);
450-
451-
/*
452-
* Maximum age of any character in s, touch at most len bytes.
453-
* Return -1 if s is not valid UTF-8 unicode.
454-
*/
455-
int utf8nagemax(const struct utf8data *data, const char *s, size_t len)
456-
{
457-
utf8leaf_t *leaf;
458-
int age = 0;
459-
int leaf_age;
460-
unsigned char hangul[UTF8HANGULLEAF];
461-
462-
if (!data)
463-
return -1;
464-
465-
while (len && *s) {
466-
leaf = utf8nlookup(data, hangul, s, len);
467-
if (!leaf)
468-
return -1;
469-
leaf_age = utf8agetab[LEAF_GEN(leaf)];
470-
if (leaf_age <= data->maxage && leaf_age > age)
471-
age = leaf_age;
472-
len -= utf8clen(s);
473-
s += utf8clen(s);
474-
}
475-
return age;
476-
}
477-
EXPORT_SYMBOL(utf8nagemax);
478-
479-
/*
480-
* Maximum age of any character in s, touch at most len bytes.
481-
* Return -1 if s is not valid UTF-8 unicode.
482-
*/
483-
int utf8nagemin(const struct utf8data *data, const char *s, size_t len)
484-
{
485-
utf8leaf_t *leaf;
486-
int leaf_age;
487-
int age;
488-
unsigned char hangul[UTF8HANGULLEAF];
489-
490-
if (!data)
491-
return -1;
492-
age = data->maxage;
493-
while (len && *s) {
494-
leaf = utf8nlookup(data, hangul, s, len);
495-
if (!leaf)
496-
return -1;
497-
leaf_age = utf8agetab[LEAF_GEN(leaf)];
498-
if (leaf_age <= data->maxage && leaf_age < age)
499-
age = leaf_age;
500-
len -= utf8clen(s);
501-
s += utf8clen(s);
502-
}
503-
return age;
504-
}
505-
EXPORT_SYMBOL(utf8nagemin);
506-
507394
/*
508395
* Length of the normalization of s.
509396
* Return -1 if s is not valid UTF-8 unicode.

fs/unicode/utf8n.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,6 @@ int utf8version_is_supported(unsigned int version);
3333
extern const struct utf8data *utf8nfdi(unsigned int maxage);
3434
extern const struct utf8data *utf8nfdicf(unsigned int maxage);
3535

36-
/*
37-
* Determine the maximum age of any unicode character in the string.
38-
* Returns 0 if only unassigned code points are present.
39-
* Returns -1 if the input is not valid UTF-8.
40-
*/
41-
extern int utf8agemax(const struct utf8data *data, const char *s);
42-
extern int utf8nagemax(const struct utf8data *data, const char *s, size_t len);
43-
44-
/*
45-
* Determine the minimum age of any unicode character in the string.
46-
* Returns 0 if any unassigned code points are present.
47-
* Returns -1 if the input is not valid UTF-8.
48-
*/
49-
extern int utf8agemin(const struct utf8data *data, const char *s);
50-
extern int utf8nagemin(const struct utf8data *data, const char *s, size_t len);
51-
5236
/*
5337
* Determine the length of the normalized from of the string,
5438
* excluding any terminating NULL byte.

0 commit comments

Comments
 (0)