Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1684256lqm; Fri, 3 May 2024 03:29:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXE127ym4lwVmEjdMotW2Gc5mo2REsVPF3oHzyURP8sVSDRrNtkglmcTkkQlUL13lzG2c79sSOjfAeROrqM2vW6Sn8FWfXbYEb3s+fxdw== X-Google-Smtp-Source: AGHT+IFYBe8HvIHbvPbtWm+M5g4DAz6APfDXUv4MCIe1+SEP+3fhV3cejhLcEb/fzNO4eq/IKovT X-Received: by 2002:a05:6870:65a9:b0:22e:d61d:a53c with SMTP id fp41-20020a05687065a900b0022ed61da53cmr2448771oab.51.1714732147899; Fri, 03 May 2024 03:29:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714732147; cv=pass; d=google.com; s=arc-20160816; b=x+yqrUi4IothtL57f5xRyreK/eQPwPcJcOIXgtQNhuFqPhlixh4+qOUuQHhneBPIvP UKSqraLzWcJ6CddOx+r5D3PqIzXgMfjbVOmSNJbroisqN6N8Q+wQ26hLWyqUBCVIsRu0 gI7fvtQ6TYRiUGeiOwG+nE2O897HFWOx62bMqW8OoGZUPqHg956P8gz1kRR8szU3Gc0c pVTzMovuCmg3e0LWhVsaqQQNKN74m79aJLaKoXa5WTwvNeDF0q6hZd+YZuG4fw2SVueS /YWS1yQLPss6Ob5aW1RkXYjSsdBrfdiMHqXpVlPepUhe1dJspRMnZD7LEpAf1sHgU/3R Vt+g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=l//WfaOHzkVwuTsY4klY1yumIrJkkUaIyUTI7phJHxM=; fh=9IwQMAOaUWIf4BROOBCn4tb7vPP2eOwsByxrZicyUpc=; b=kdcSr4j4EE59YBTMAqA8U0tCXGh74yGkoTHqXCUU91gu1IorAdZE5qJZ99NzHda66q gkUUJUJdPXKHQv9In98pf9FRqI1zKDZN8S45PZXhJXHzMvyb2hTXpL8vk8sfrPls/3HP Q2ylhoHn1Wvy38HX4dswmCYhNh9hXgMb0mz6Q+Ykw9xfgMsWig1AJZ3MiuV9q+R2PaTK M8kQgAyNN/AoCj3a56SwjespSAHiAEuNNMkl7l41Zw+7TjtC8MO0uPOw+YtjESzTGJWU WYpxNzlrKnSWkjWgK8bkR1Itc0UQ6ZBHF1G4Ga2kvd0Ycc7H6VkIFMBm1gDqLOpi1uNq XAKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CVexwY3l; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-167518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167518-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i9-20020a654849000000b005c661524f67si2615599pgs.26.2024.05.03.03.29.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 03:29:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CVexwY3l; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-167518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167518-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id AA80A282B95 for ; Fri, 3 May 2024 10:28:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 657651509AC; Fri, 3 May 2024 10:28:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CVexwY3l" 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 671FD14BF85; Fri, 3 May 2024 10:28:14 +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=1714732094; cv=none; b=g6U9v2B13qKiqDKuezJb2bopsScZ8qqaKdumrSMi7kbD4Dc68W2Pe66F7tB8Az8rUuPrQcGRx3JvBXQgt2BETE7BGxYhooXViwVzokMhYfv7gghwbOUicw1W94OPk6RkdubS/H74+0jrBbOoi1KkexmFlfYy61LUsun/R+eWw8A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714732094; c=relaxed/simple; bh=OntdBaerXi3AJ/zLXyZcNtMvP/PzL6ZafwOb4BeMmI8=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PffkdFOFJaZ9ggqMuDg6SwkKmpcyCvwNIkTX4kWEmGCoPj3jkzFfSbfFrOG1S+bf1g6I8T8sU+BE1SCMv/q4kAShqhK2uhHRzxbyUQcs9dT9jSUDRAS2F6EbKLtffiBfU/DpnM4ruK3YvokqISH7QZREkCVYpKOA5XA0h4c6Fe0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CVexwY3l; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86C52C116B1; Fri, 3 May 2024 10:28:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714732094; bh=OntdBaerXi3AJ/zLXyZcNtMvP/PzL6ZafwOb4BeMmI8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CVexwY3lU9pEyrjVDtImt5My3VLqjq0O6pu4tXHAYXra+R/yyivA0NvhfTLZ09e0A cxbBIdKBwsREn30DGoNQVdBGNnjfuk75/VpipXdN/6ZvWZCfIKVtqVsOxiXD66T88L 3sCcvCfpeYvNOoP9K2/otFr5CSejsUV24l3x7xiLmlJ2OYwtrX4t6Z6ZRbVrQ+yG7x 8TpvvQD0STMgj41jXX4MiXNiccAK0MNa6GSxqKlDQTZ05zw2Bzltst6RLpU6SK1jGx 3MalcpgYNan36bYB7hjf438rPRn0mK7fZRYgacV4KlzCbym7pY6M6KQ7QdGTsVih8M SjyAg0MIerKAg== Date: Fri, 3 May 2024 11:27:58 +0100 From: Mauro Carvalho Chehab To: Ricardo Ribalda Cc: Martin Tuma , Laurent Pinchart , Hugues Fruchet , Alain Volmat , Maxime Coquelin , Alexandre Torgue , Paul Kocialkowski , Greg Kroah-Hartman , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Sakari Ailus , Thierry Reding , Jonathan Hunter , Sowjanya Komatineni , Luca Ceresoli , Matthias Brugger , AngeloGioacchino Del Regno , Hans Verkuil , Sergey Kozlov , Abylay Ospan , Ezequiel Garcia , Dmitry Osipenko , Benjamin Mugnier , Sylvain Petinot , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH v3 26/26] media: dvb-frontends: tda10048: Make the range of z explicit. Message-ID: <20240503112758.763d8d31@sal.lan> In-Reply-To: <20240429-fix-cocci-v3-26-3c4865f5a4b0@chromium.org> References: <20240429-fix-cocci-v3-0-3c4865f5a4b0@chromium.org> <20240429-fix-cocci-v3-26-3c4865f5a4b0@chromium.org> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Em Mon, 29 Apr 2024 15:05:05 +0000 Ricardo Ribalda escreveu: > We do not expect the sample_freq to be over 613MHz. > > Found by cocci: > drivers/media/dvb-frontends/tda10048.c:345:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_u64 instead. > > Signed-off-by: Ricardo Ribalda > --- > drivers/media/dvb-frontends/tda10048.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/dvb-frontends/tda10048.c b/drivers/media/dvb-frontends/tda10048.c > index 3e725cdcc66b..1886f733dbbf 100644 > --- a/drivers/media/dvb-frontends/tda10048.c > +++ b/drivers/media/dvb-frontends/tda10048.c > @@ -328,7 +328,8 @@ static int tda10048_set_wref(struct dvb_frontend *fe, u32 sample_freq_hz, > u32 bw) > { > struct tda10048_state *state = fe->demodulator_priv; > - u64 t, z; > + u32 z; > + u64 t; > > dprintk(1, "%s()\n", __func__); > > @@ -341,6 +342,7 @@ static int tda10048_set_wref(struct dvb_frontend *fe, u32 sample_freq_hz, > /* t *= 2147483648 on 32bit platforms */ > t *= (2048 * 1024); > t *= 1024; > + /* Sample frequency is under 613MHz */ Are you sure about that? Some DVB devices have very high frequency clocks, specially if they're also used for satellite, so I can't be sure by just looking at the driver's code. Also, we had already a bunch of regressions with "fixes" like this that actually broke frontend drivers. If you're sure, please add a note at the description mentioning on what part of the datasheet you got it. Otherwise, let's stick with the current code and address cocci warning on a different way. Regards, Mauro PS.: I partially applied this patch series. I left a few patches out of the merge to let other people review/comment (and/or for me to take a deeper look later on). Regards, Mauro