Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp734207lqh; Thu, 28 Mar 2024 14:58:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUsVjfWM+ZVA21zMFvlq2AzyCiQAto8b5rj0+sytsxavnVEcJS6IqEp4H8hhv7Jw8xIiNo6XYyPFqzPqTgdkUXYWAswOMAtXMqf0uxlmQ== X-Google-Smtp-Source: AGHT+IH2WPYZudGDbC2l1H6hqnAAdMFflbQ/8olplafcOV2EbEVjCj3QkGyczJo2VB92xcM20dc1 X-Received: by 2002:a05:620a:f0c:b0:78a:6841:747 with SMTP id v12-20020a05620a0f0c00b0078a68410747mr6145791qkl.4.1711663111952; Thu, 28 Mar 2024 14:58:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711663111; cv=pass; d=google.com; s=arc-20160816; b=vWf4YgUOhWpkeBs2NrAJxOKWbWQUVH7vQsk++hKt5fCq1b6l25CRBek0J2zXCsUJDC zulFzOucdngDLuH/7FSZKwdhIPK2KZj3BXVOIjP8e6mX6IGnbJ5xQuoBDNe248+95Sgu UvG0fOi29wPdZjw18lVDAmuC1kFY/axNubMILcWXRtUZF5BaF0h/Lo/gZ+bYqTxvf+yO UaK3wv2ITayFrMXT4zi//xiOIf+jlKjtQv/gq5SauAFp6DJlLFjdH8hBuE0O3nUtBCbt vdW8I2x4t1DL7Mb8bNwGMwIsHtDPtib39Dc0+L3pZPYDTI11ti/b8fkUEFYinrOObTC+ XKJg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=BxsKZxZUzuDOnaAX/evvGdiqGyKkkrreXD8So3xuleM=; fh=84X1WS3Z4UkAbMrb2qT3Enxw3aG2NXCQvX9VwNMFFoQ=; b=c1bipAd8FXwLt1mmRp7o4ihJUM96rB3Cef3iGb53dyF/H3vQOmm4w9X5p86pMFUeWB 9mQzgj/OowXySLz46KW6OSGLWB0Y40nEaGJ6zFX0XyXM+TFlpxuW4MyJ8H1Y5vfW4bwg nLdXBD1pXcP5osHuQp36JjqSQ/8K9Vf34vvJ4myAAW4Wrgd1MXskt/TCmNiQp/fbCAAe WDYJJbYPmjWrrORemPmOXfWUqHqXqut79HbRz/nZVf5xMlizZbtHgJiiKLNpoq8bdvQr sLPgA5d/+y1C+52euGZtN/s2CmCSKAl82ZqOKaLPjSSvUiE/l+gmFrcAzZTVKz6w6m4T Y88g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=MEsPzbYo; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-123695-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123695-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id bn10-20020a05620a2aca00b0078bbe55a5aesi1928175qkb.258.2024.03.28.14.58.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 14:58:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123695-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=MEsPzbYo; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-123695-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123695-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id AD9211C291FE for ; Thu, 28 Mar 2024 21:58:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2703213B592; Thu, 28 Mar 2024 21:58:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="MEsPzbYo" Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A14CA13AD3B for ; Thu, 28 Mar 2024 21:58:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711663104; cv=none; b=mvzAlrkaBbbrVwgyo+SrpN9ERNUzvZnNaKZtaAIrua6963CjTVhVi4rdk2Ej85ZoOTNvVMzq06UMjO84SGy5WajPbDCm+juvX8gPf+gYUzmdMEhhCmm/BEihj7SL4k4zaqE1xv0OKUiFj7/zju+r9c73eXmWZ2aiUxTNf7fktTk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711663104; c=relaxed/simple; bh=EVOmIevOY7yIjg6tCh+xVx1hJEYZK8SikqOcoPFgsDo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=tY4SOtyBFIiT7iZxf4ky2tIlJuDFin00JkTimxQyvAH8vMogYkb9VDJzB96B2bZlyqpMN30e4cq6kvyLNOH5kiI9QGe0qnpi/Gb5AXaSH3M87zGL9rtz4fZuNVyYyvKs4OXN/mgFkzA6nyIiJmwxQRwFvNcEqYlJeQuu8FCL75I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=MEsPzbYo; arc=none smtp.client-ip=209.85.208.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-56c404da0ebso2242906a12.0 for ; Thu, 28 Mar 2024 14:58:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1711663101; x=1712267901; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=BxsKZxZUzuDOnaAX/evvGdiqGyKkkrreXD8So3xuleM=; b=MEsPzbYoZIVNx5SGkMZr/mYjmInQ200p5GDl/yCHt/kdEY//fbNsZcTVIxrna3hI+a fGaGnCGioOBvTAhXc//7rkfG+uGcXVnXrrx8vP2WzoaIQqyJ5DHcdyp/zunn70pAbNv0 cGZlfwXpnhqGURPlcSPktJdCWvDISuY1yWFXjErg/KSZtK/abww9gWt8uTJSJ3paZ1kw cTYq4GB7Bv/XD49HO30Xh/LuuewG2F0CFzJMDJ75Dx7T6I7y4mBI+n57jbEeHO3Yn0jz LI5I3KOiLm2YLu+UtW+ASmq6/VPlvxXJ3jKcwmteDQnT56EDDO3ZIo0cldJ1PYidiI5x oqTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711663101; x=1712267901; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BxsKZxZUzuDOnaAX/evvGdiqGyKkkrreXD8So3xuleM=; b=MaEcU4FcuV6t0XuGaiWy/aT2nNYV+1/UqVsqN8VGTBncrNMYOZAVDT/u8CIZxoEMqF 90gSX6gZZQ+Oa25qRxG10uowTaVYuONK4fXy2wCK/+seT33NLwo6Cfs79EkBdAi+IDt5 z0KX5NCBfrqg7GtX8OALlhB5XXLEL46RJvpWSC32RNSB8GtCzVUdGzjNka2zWRf43SEm 0hoZ1RWwRDB86CJO5mLeSCLUMExfkSDNV9JkTLVAWlQfUITDS4Ui7HnOSeDy0yD65woy V9mTPuuFAekmMW5gSxqe3s/4r2NlYLHEtVHk2UsWnbgXOkaJzyVOSO08Rwja6ZwBbGkm e1kg== X-Gm-Message-State: AOJu0YwugZyjPzV7iGRENn+g9mN9krA0OTbW0q6i9PgG78Jms1n1v2Bv TUHTDBIMD0TIw8fobgdNCNovIvnms2wRjq0HHnBY0eB2wNcL6+eimVcHV3XiwYm5ZWkckVy58xy uMU5BGTMmtqdevdr3fJscv6/qND0XelmOn/Pz X-Received: by 2002:a05:6402:51c9:b0:568:32f7:6c53 with SMTP id r9-20020a05640251c900b0056832f76c53mr421604edd.3.1711663100915; Thu, 28 Mar 2024 14:58:20 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240328143051.1069575-1-arnd@kernel.org> <20240328143051.1069575-2-arnd@kernel.org> In-Reply-To: <20240328143051.1069575-2-arnd@kernel.org> From: Justin Stitt Date: Thu, 28 Mar 2024 14:58:08 -0700 Message-ID: Subject: Re: [PATCH 1/9] dm integrity: fix out-of-range warning To: Arnd Bergmann Cc: linux-kernel@vger.kernel.org, Alasdair Kergon , Mike Snitzer , Mikulas Patocka , dm-devel@lists.linux.dev, Nathan Chancellor , Arnd Bergmann , Nick Desaulniers , Bill Wendling , Eric Biggers , llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 28, 2024 at 7:31=E2=80=AFAM Arnd Bergmann wro= te: > > From: Arnd Bergmann > > Depending on the value of CONFIG_HZ, clang compares about a pointless > comparison: > > drivers/md/dm-integrity.c:4085:12: error: result of comparison of constan= t 42949672950 with expression of type 'unsigned int' is always false [-Werr= or,-Wtautological-constant-out-of-range-compare] > if (val >=3D (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. Yeah, nice. > > Fixes: 468dfca38b1a ("dm integrity: add a bitmap mode") > Signed-off-by: Arnd Bergmann Reviewed-by: Justin Stitt > --- > 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 37b9f8f1ae1a..7f3dc8ee6ab8 100644 > --- a/drivers/md/dm-integrity.c > +++ b/drivers/md/dm-integrity.c > @@ -4221,7 +4221,7 @@ static int dm_integrity_ctr(struct dm_target *ti, u= nsigned int argc, char **argv > } else if (sscanf(opt_string, "sectors_per_bit:%llu%c", &= llval, &dummy) =3D=3D 1) { > log2_sectors_per_bitmap_bit =3D !llval ? 0 : __il= og2_u64(llval); > } else if (sscanf(opt_string, "bitmap_flush_interval:%u%c= ", &val, &dummy) =3D=3D 1) { > - if (val >=3D (uint64_t)UINT_MAX * 1000 / HZ) { > + if ((uint64_t)val >=3D (uint64_t)UINT_MAX * 1000 = / HZ) { > r =3D -EINVAL; > ti->error =3D "Invalid bitmap_flush_inter= val argument"; > goto bad; > -- > 2.39.2 >