Skip to content

Commit c473bcd

Browse files
arndbbrauner
authored andcommitted
nilfs2: fix out-of-range warning
clang-14 points out that v_size is always smaller than a 64KB page size if that is configured by the CPU architecture: fs/nilfs2/ioctl.c:63:19: error: result of comparison of constant 65536 with expression of type '__u16' (aka 'unsigned short') is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (argv->v_size > PAGE_SIZE) ~~~~~~~~~~~~ ^ ~~~~~~~~~ This is ok, so just shut up that warning with a cast. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20240328143051.1069575-7-arnd@kernel.org Fixes: 3358b4a ("nilfs2: fix problems of memory allocation in ioctl") Acked-by: Ryusuke Konishi <konishi.ryusuke@gmail.com> Reviewed-by: Justin Stitt <justinstitt@google.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 0a4f544 commit c473bcd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nilfs2/ioctl.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static int nilfs_ioctl_wrap_copy(struct the_nilfs *nilfs,
6060
if (argv->v_nmembs == 0)
6161
return 0;
6262

63-
if (argv->v_size > PAGE_SIZE)
63+
if ((size_t)argv->v_size > PAGE_SIZE)
6464
return -EINVAL;
6565

6666
/*

0 commit comments

Comments
 (0)