Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1806167lqm; Fri, 3 May 2024 07:09:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXGiCCbzVBsrLbPXFuNUuptFzdwf/Ii7nFBWcMc0MYM6hQH66t6wfpH9PFAu1Bc8UtUq96fFIYGaOaqF7GfKrdcOn+uKXsp6V4xah6a/g== X-Google-Smtp-Source: AGHT+IFh1RqB8vyS4hxTa+JbzHPrKPkAgBn/2NU8fQ5WlmLXdrtcWvK4XSDtxHc+WI0WkRr4/Arp X-Received: by 2002:a05:6808:2792:b0:3c8:4d20:34b7 with SMTP id es18-20020a056808279200b003c84d2034b7mr2727469oib.22.1714745349398; Fri, 03 May 2024 07:09:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714745349; cv=pass; d=google.com; s=arc-20160816; b=yiD2f6HH8kAXLozs636w3fDtK2qn0c0lT76fBxVDw+NJOCUKG4SnKqFYrie58hSmo9 b6vtijr/Mr/1IqgKbMZ+X/ADMFTI0c559X3+6WwOby/PeWkaH1W3TCwmrcIY0wLuEonT Zb7eccJAj8b7D6mo0geJDbmfovSnQK04eVWccwdeRSlWkqYLzquCIpV0BG5jUNQo0WjN eKm79BJSrT5xJwJNKbhHZ9sZuRl0GqlxIr5xdhpOkkyzFlghKBEZ7SDYkt2RvmG2L9ui 72vZbeJXbwTBBENakwsIFdvfpo5myKXOH79ErsrZ1Z/5Kd8/hDSWAIwwZnpGS27H/4Mw uqKA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:message-id:references:in-reply-to:subject :cc:to:from:date:dkim-signature:mime-version:list-unsubscribe :list-subscribe:list-id:precedence; bh=3C+MgtjD5FFzr1H8ErTkKFFC7gX/7QwO2uuYNs38Akc=; fh=WQzejKlngKxd6bvVRsL+y9LsVHbvTFcybH2t5YZg6uk=; b=YNLewXf7rqyOy571AgME9rTzk1+M0qwwF0nZnA1BxuUz8DNq8LXEBBpS16hGeALjCz /dWYkpxA+iH1YhWv0Lys5CFn6zzxk5iPa+Q+n3QyWv9UKmxvwtf2Lpg2tHeUchmPajEP /B5r5t5vgH61PZSCGNjCB3fCsDFcxO7pRqFvb+D3G/1ukQvdj/4oPGvq9MT5/SHFm8w9 5xUC1u4fQgoc7Ke8cQG08jj8p+M1vuia878EBVcdXvio+5Ula1tGgp17O3PNquZcNYhk F9G1RM5mJr+F4zi85jgvzGWm4OCiX1FxhwVdFK346FTq44VSYKUKIeuQXNykd7hDw+s/ feoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@manjaro.org header.s=2021 header.b=mAarC0LY; arc=pass (i=1 spf=pass spfdomain=manjaro.org dkim=pass dkdomain=manjaro.org dmarc=pass fromdomain=manjaro.org); spf=pass (google.com: domain of linux-kernel+bounces-167745-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167745-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=manjaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bc21-20020a0561220d9500b004d8781f1923si753048vkb.160.2024.05.03.07.09.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 07:09:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167745-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@manjaro.org header.s=2021 header.b=mAarC0LY; arc=pass (i=1 spf=pass spfdomain=manjaro.org dkim=pass dkdomain=manjaro.org dmarc=pass fromdomain=manjaro.org); spf=pass (google.com: domain of linux-kernel+bounces-167745-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167745-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=manjaro.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7A4BC1C20C9A for ; Fri, 3 May 2024 14:09:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AA96B154C00; Fri, 3 May 2024 14:08:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=manjaro.org header.i=@manjaro.org header.b="mAarC0LY" Received: from mail.manjaro.org (mail.manjaro.org [116.203.91.91]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52F44152184; Fri, 3 May 2024 14:08:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=116.203.91.91 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714745335; cv=none; b=kwYjWZfsb1Qr8tNkPaLn+5Ce/dVIp0oPZRiaHUtHTkF7lXQJ66oy4jUHJ2bS58FnCtE/uP9ZRImCddpmsViIzlUAmq5qW4NhnaN8fwQpK70ZNkdfrWR4x4Krr8JJEutd/YCTaZ3LsDND6AqupxsYCxbXsNvY3Hl9EdYsJdyC5b0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714745335; c=relaxed/simple; bh=+kPnKcYBQEaIz35grdcmnn1EGJxQ/kAtMsbVmsDrItw=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type; b=j04s6tX3jVPT+YUacflG2Z+XvmrazAijJQc+Rgt/wq/YuXrB9sdfyzHgqv1nTYLufHgrkjhOt5imlYzQu/HmHN+QIteEMmPDp9OMcCx4uSxG1XZ3dDtuWLjPcKrhpdq8PQLbzf1Ev+ZEYZdVSvmXeLfMlpFsME5QIsTaNQmDaF0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=manjaro.org; spf=pass smtp.mailfrom=manjaro.org; dkim=pass (2048-bit key) header.d=manjaro.org header.i=@manjaro.org header.b=mAarC0LY; arc=none smtp.client-ip=116.203.91.91 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=manjaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=manjaro.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1714745331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3C+MgtjD5FFzr1H8ErTkKFFC7gX/7QwO2uuYNs38Akc=; b=mAarC0LY0zCqC2ZrO6f/B0kd24XVsuHukHHUkTxv8x6uP89ukwITU0O3Ynvicd1D1E9pAe IO3tmU10O6igCP8QZy19eeUc6Ld3IxJqvuNP1A5HBT6M5ThYS4BpN1w2gd1THv6O1jAK7/ ezGJ5lRjzzWduiC7DpEa6et6y5QamPHTjx/cHxFoa92YbVL3l6ufWF1RIr8LLxjgxMNHq8 xLmLl+oEm7sIthlsxDBs1Nx//ZO6J02vTNuOw0f8VgzJgXGDL/8MklHPqBILGlrXprDE9w hibkEuHJ/OUQOHG1dbrTz8I/N/GLzP9y5rNue5qKcnd9Fy1V2tSamIAR/DWm+g== Date: Fri, 03 May 2024 16:08:48 +0200 From: Dragan Simic To: Ricardo Ribalda Cc: Dan Carpenter , Mauro Carvalho Chehab , 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. In-Reply-To: References: <20240429-fix-cocci-v3-0-3c4865f5a4b0@chromium.org> <20240429-fix-cocci-v3-26-3c4865f5a4b0@chromium.org> <20240503112758.763d8d31@sal.lan> Message-ID: X-Sender: dsimic@manjaro.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Authentication-Results: ORIGINATING; auth=pass smtp.auth=dsimic@manjaro.org smtp.mailfrom=dsimic@manjaro.org Hello Ricardo, On 2024-05-03 13:56, Ricardo Ribalda wrote: > I am trying to get the DS, but > https://www.nxp.com/acrobat_download/literature/9397/75015931.pdf is a > dead links now. > > Anyone have access to the datasheet? It's kind of available on the link below, but for some strange reason the download fails after downloading the first 128 KB or so. https://web.archive.org/web/20080907185532/https://www.nxp.com/acrobat_download/literature/9397/75015931.pdf > On Fri, 3 May 2024 at 13:55, Dan Carpenter > wrote: >> >> On Fri, May 03, 2024 at 11:27:58AM +0100, Mauro Carvalho Chehab wrote: >> > 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. >> >> This patch preserves the existing behavior. The sample_freq_hz >> variable >> is a u32 so, in the original code, z couldn't have been more than >> U32_MAX even though it was declared as a u64. >> >> It's possible that the original code was wrong. We have seen that in >> other places in this patchset. Adding a note about the datasheet is >> also a good idea. >> >> regards, >> dan carpenter >>