Commit 197298a6 authored by Pali Rohár's avatar Pali Rohár Committed by Namjae Jeon
Browse files

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: default avatarPali Rohár <pali@kernel.org>
Signed-off-by: default avatarNamjae Jeon <namjae.jeon@samsung.com>
parent 3d77e6a8
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -185,13 +185,8 @@ 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 {
			if (u_a != u_b)
				return 1;
		}
	}