]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nilfs2: fix out-of-range warning
authorArnd Bergmann <arnd@arndb.de>
Thu, 28 Mar 2024 14:30:44 +0000 (15:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 May 2024 07:48:57 +0000 (09:48 +0200)
commit6c4f58fc49bed4d15ec75cac7f8096fefa25ad09
tree87a6dd6c375291d58f8ae2ec67d53e100e92b570
parenta20f09452e2f58f761d11ad7b96b5c894c91030e
nilfs2: fix out-of-range warning

[ Upstream commit c473bcdd80d4ab2ae79a7a509a6712818366e32a ]

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: 3358b4aaa84f ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nilfs2/ioctl.c