Blame SOURCES/0023-exfat-Simplify-exfat_utf8_d_cmp-for-code-points-abov.patch

Kmods SIG 9e3ffb
From 197298a64983e2beaf1a87413daff3044b4f3821 Mon Sep 17 00:00:00 2001
Kmods SIG 9e3ffb
From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
Kmods SIG 9e3ffb
Date: Tue, 17 Mar 2020 22:34:33 +0100
Kmods SIG 9e3ffb
Subject: [Backport 197298a64983] exfat: Simplify exfat_utf8_d_cmp() for code
Kmods SIG 9e3ffb
 points above U+FFFF
Kmods SIG 9e3ffb
MIME-Version: 1.0
Kmods SIG 9e3ffb
Content-Type: text/plain; charset=UTF-8
Kmods SIG 9e3ffb
Content-Transfer-Encoding: 8bit
Kmods SIG 9e3ffb
Kmods SIG 9e3ffb
If two Unicode code points represented in UTF-16 are different then also
Kmods SIG 9e3ffb
their UTF-32 representation must be different. Therefore conversion from
Kmods SIG 9e3ffb
UTF-32 to UTF-16 is not needed.
Kmods SIG 9e3ffb
Kmods SIG 9e3ffb
Signed-off-by: Pali Rohár <pali@kernel.org>
Kmods SIG 9e3ffb
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Kmods SIG 9e3ffb
---
Kmods SIG 9e3ffb
 src/namei.c | 9 ++-------
Kmods SIG 9e3ffb
 1 file changed, 2 insertions(+), 7 deletions(-)
Kmods SIG 9e3ffb
Kmods SIG 9e3ffb
diff --git a/src/namei.c b/src/namei.c
Kmods SIG 9e3ffb
index a2659a8a68a14273eeff16dd467d771ebe038b43..731da41cabbf7b9dfd38f001fc502573bfd6c078 100644
Kmods SIG 9e3ffb
--- a/src/namei.c
Kmods SIG 9e3ffb
+++ b/src/namei.c
Kmods SIG 9e3ffb
@@ -185,14 +185,9 @@ static int exfat_utf8_d_cmp(const struct dentry *dentry, unsigned int len,
Kmods SIG 9e3ffb
 		if (u_a <= 0xFFFF && u_b <= 0xFFFF) {
Kmods SIG 9e3ffb
 			if (exfat_toupper(sb, u_a) != exfat_toupper(sb, u_b))
Kmods SIG 9e3ffb
 				return 1;
Kmods SIG 9e3ffb
-		} else if (u_a > 0xFFFF && u_b > 0xFFFF) {
Kmods SIG 9e3ffb
-			if (exfat_low_surrogate(u_a) !=
Kmods SIG 9e3ffb
-					exfat_low_surrogate(u_b) ||
Kmods SIG 9e3ffb
-			    exfat_high_surrogate(u_a) !=
Kmods SIG 9e3ffb
-					exfat_high_surrogate(u_b))
Kmods SIG 9e3ffb
-				return 1;
Kmods SIG 9e3ffb
 		} else {
Kmods SIG 9e3ffb
-			return 1;
Kmods SIG 9e3ffb
+			if (u_a != u_b)
Kmods SIG 9e3ffb
+				return 1;
Kmods SIG 9e3ffb
 		}
Kmods SIG 9e3ffb
 	}
Kmods SIG 9e3ffb
 
Kmods SIG 9e3ffb
-- 
Kmods SIG 9e3ffb
2.31.1
Kmods SIG 9e3ffb