]> www.infradead.org Git - users/dwmw2/linux.git/commit
dm integrity: fix out-of-range warning
authorArnd Bergmann <arnd@arndb.de>
Thu, 28 Mar 2024 14:30:39 +0000 (15:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:19:36 +0000 (16:19 +0200)
commitb8438db837322c363f3b80c1588dd923f05a670a
tree401fc8729de623380a200f0ad29f7e6ca1850d47
parentbef3bc962dcc4dde9a53b1504e1fd28212c718f8
dm integrity: fix out-of-range warning

[ Upstream commit 8e91c2342351e0f5ef6c0a704384a7f6fc70c3b2 ]

Depending on the value of CONFIG_HZ, clang complains about a pointless
comparison:

drivers/md/dm-integrity.c:4085:12: error: result of comparison of
                        constant 42949672950 with expression of type
                        'unsigned int' is always false
                        [-Werror,-Wtautological-constant-out-of-range-compare]
                        if (val >= (uint64_t)UINT_MAX * 1000 / HZ) {

As the check remains useful for other configurations, shut up the
warning by adding a second type cast to uint64_t.

Fixes: 468dfca38b1a ("dm integrity: add a bitmap mode")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Justin Stitt <justinstitt@google.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/dm-integrity.c