[PATCH -mm] -funsigned-char, namei: delete cast in lookup_one_common()

From: Alexey Dobriyan
Date: Thu Oct 20 2022 - 05:56:34 EST


Cast to unsigned int doesn't do anything because two comparisons are
a) for equality, and
b) both '/' and '\0' have non-negative values.

Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>
---

fs/namei.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2657,7 +2657,7 @@ static int lookup_one_common(struct user_namespace *mnt_userns,
}

while (len--) {
- unsigned int c = *(const unsigned char *)name++;
+ char c = *name++;
if (c == '/' || c == '\0')
return -EACCES;
}