From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 444F82DF73; Mon, 8 Apr 2024 13:08:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712581680; cv=none; b=ehn30DCJ+CSbTGBvO6BT0p3b6hodUfNUAHxjQJfBzf5akmDSTAT5IiWc78wB3wkmArtJONF1BS6csCBxy+B5TmV6J+R/5ke9JftbqY0DSNq3UxGObK7eAH+j6nJB//CrlthhoSO5ccX1R3oWSc3YLvd7DZn0ypfoupfRGQ1g53E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712581680; c=relaxed/simple; bh=u+tiSeUGJkD/HykCYr4umzTY1uKH42b3G/t0Aru+rWY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rhiaM4k1C4dorZPbpzDoUkhi427OCK98P7GU+59CwKMmePMHLhrrlG865yQ3BgHDt2YVjTQ5pLtbwJJ0BIG3dtYLf7nbtJhP4Fw1Z2Hre+WlNGPf2nUpJBmjBE/mHv/5s5/Z0eJTrNOunoY7GWTC0/5wwwjHv/FCfAMKcd+J4SA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=xXoznwvR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="xXoznwvR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5AF4C433F1; Mon, 8 Apr 2024 13:07:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712581680; bh=u+tiSeUGJkD/HykCYr4umzTY1uKH42b3G/t0Aru+rWY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xXoznwvRdKiwC7h+QO1DWtHw49G017GkpQWIQq0KAYljT3UFCY21yIqhKVV9jvDRe L+yiUX/2+PwyvjWhoblNq6Q0FalOZ1+LOdBZEnhAHW/EaUEJGql1RoJz/tfAcy1QgK GPVwY0NaQMo1pCeJ6bT9h9/Tc1peyO6917eNNCc8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Arnd Bergmann , Mikulas Patocka , Justin Stitt , Mike Snitzer , Sasha Levin Subject: [PATCH 6.1 023/138] dm integrity: fix out-of-range warning Date: Mon, 8 Apr 2024 14:57:17 +0200 Message-ID: <20240408125256.950431808@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240408125256.218368873@linuxfoundation.org> References: <20240408125256.218368873@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann [ 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 Reviewed-by: Mikulas Patocka Reviewed-by: Justin Stitt Signed-off-by: Mike Snitzer Signed-off-by: Sasha Levin --- drivers/md/dm-integrity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index 9c9e2b50c63c3..696365f8f3b5f 100644 --- a/drivers/md/dm-integrity.c +++ b/drivers/md/dm-integrity.c @@ -4167,7 +4167,7 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned int argc, char **argv } else if (sscanf(opt_string, "sectors_per_bit:%llu%c", &llval, &dummy) == 1) { log2_sectors_per_bitmap_bit = !llval ? 0 : __ilog2_u64(llval); } else if (sscanf(opt_string, "bitmap_flush_interval:%u%c", &val, &dummy) == 1) { - if (val >= (uint64_t)UINT_MAX * 1000 / HZ) { + if ((uint64_t)val >= (uint64_t)UINT_MAX * 1000 / HZ) { r = -EINVAL; ti->error = "Invalid bitmap_flush_interval argument"; goto bad; -- 2.43.0