aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exfat/namei.c
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2020-03-17 22:34:33 +0100
committerNamjae Jeon <namjae.jeon@samsung.com>2020-06-09 16:48:28 +0900
commit197298a64983e2beaf1a87413daff3044b4f3821 (patch)
treeae6fd19f59a4e06321ae84adcbc713cd2b1d59a5 /fs/exfat/namei.c
parentLinux 5.7 (diff)
downloadlinux-dev-197298a64983e2beaf1a87413daff3044b4f3821.tar.xz
linux-dev-197298a64983e2beaf1a87413daff3044b4f3821.zip
exfat: Simplify exfat_utf8_d_cmp() for code points above U+FFFF
If two Unicode code points represented in UTF-16 are different then also their UTF-32 representation must be different. Therefore conversion from UTF-32 to UTF-16 is not needed. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Diffstat (limited to 'fs/exfat/namei.c')
-rw-r--r--fs/exfat/namei.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c
index a2659a8a68a1..731da41cabbf 100644
--- a/fs/exfat/namei.c
+++ b/fs/exfat/namei.c
@@ -185,14 +185,9 @@ static int exfat_utf8_d_cmp(const struct dentry *dentry, unsigned int len,
if (u_a <= 0xFFFF && u_b <= 0xFFFF) {
if (exfat_toupper(sb, u_a) != exfat_toupper(sb, u_b))
return 1;
- } else if (u_a > 0xFFFF && u_b > 0xFFFF) {
- if (exfat_low_surrogate(u_a) !=
- exfat_low_surrogate(u_b) ||
- exfat_high_surrogate(u_a) !=
- exfat_high_surrogate(u_b))
- return 1;
} else {
- return 1;
+ if (u_a != u_b)
+ return 1;
}
}