diff mbox series

[-next] mm: shmem: Fix an incorrect type in shmem_parse_opt_casefold()

Message ID 20241031030025.32217-1-jiapeng.chong@linux.alibaba.com (mailing list archive)
State New
Headers show
Series [-next] mm: shmem: Fix an incorrect type in shmem_parse_opt_casefold() | expand

Commit Message

Jiapeng Chong Oct. 31, 2024, 3 a.m. UTC
The return value from the call to utf8_parse_version() is int.
However, the return value is being assigned to an unsiged int
variable 'version', so making 'version' an int.

./mm/shmem.c:4368:6-13: WARNING: Unsigned expression compared with zero: version < 0.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=11587
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 mm/shmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/mm/shmem.c b/mm/shmem.c
index 3560188fe329..a1835f528581 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -4355,7 +4355,7 @@  static int shmem_parse_opt_casefold(struct fs_context *fc, struct fs_parameter *
 				    bool latest_version)
 {
 	struct shmem_options *ctx = fc->fs_private;
-	unsigned int version = UTF8_LATEST;
+	int version = UTF8_LATEST;
 	struct unicode_map *encoding;
 	char *version_str = param->string + 5;