Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp523796lqt; Fri, 19 Apr 2024 03:00:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWYjmTN5AgPwe9pimOV74ODa40NKHmvuNnu28Icx/RbTUoBHKUuNRvcJNOfrJ5KWwLa+cejnA8MjqX3IY6f17tc9pz4sTNWGNEugzjHnQ== X-Google-Smtp-Source: AGHT+IGecHBoZgmmL3k4aSPN7Z9mawcJoVCgSGK8m5ibITfcd+Ag+vtVjy1OpjfzxdE3faiX44hy X-Received: by 2002:a92:c247:0:b0:36b:fa92:2824 with SMTP id k7-20020a92c247000000b0036bfa922824mr1919253ilo.29.1713520813286; Fri, 19 Apr 2024 03:00:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713520813; cv=pass; d=google.com; s=arc-20160816; b=JsQg0LoMHho66TEXKd1KjB1XMVaBq7LkKxmtWCJux756Vr85eFLvD5o8/dkYnX0xvq Mk/J0awWrGoBa3PJCi0dPbpjTGXQcW5MCOz+S6aFltKDr1Wh7HsBRD/VlBrj1PikHsvQ sa60byyrnlpa19riryWq12NmpgLIi0TWg8IwNDXsvPm9QC1T4PtLYoU1OQsc4/h0yERD FJidt8a3JjP/SxlbIASngDWEK7z7VxlRsayWv2czwT6QzStr3E8xcTxxP5NlEN22+vEE Ta0WbEq/IfAnlpj7AqkRGUuCneboVClIyE9L+ncVVwNj9SuXEHGOnvY+IlJDl0hhlLiz 1S3A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=STqazHEagBxWlHC69lQFp5WbvQ2Sdx8rB6+uKcUB0cU=; fh=LgCixLqCgL7FUhIji+RpdqYYd9AfxzWkL9QTMIR16yI=; b=NEUnjv9w5iNbgftW0LOYGa9uBeEjJDq6ks+mZ9eyeqBio0n6UrUXC4VA8Nb9orVlsx Rmlyqb/NMKTyRbizuRHdXIkIrgED9RX0mW0WneiJ+vRfJn4pCqq9bWIlYr8LfPRVu0Nf 1XJpiDnzAzumDAN6XlogpBv3iYErxT/lZR/mgt0crBWCXFMAiOihMyPpL/1MWwPovd6d 6srB1nGkj9HJ9A+DQuiePryAnqDFahdGojLmMp1fDF0guBUTBAHKzmUiT1xUuK52zaw7 Ox/kgx4c/s75XTNzhlRVVo0U07o/iPCvuMBC8aPsmuGnYEZUHpAIrNlI41Jw9vi+G9qW k52g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZuGUNop+; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-151273-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151273-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id g2-20020a6544c2000000b005dcbb6b4bffsi3053893pgs.335.2024.04.19.03.00.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 03:00:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151273-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZuGUNop+; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-151273-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151273-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id DA36EB22FAD for ; Fri, 19 Apr 2024 09:57:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7C90D135A7E; Fri, 19 Apr 2024 09:49:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ZuGUNop+" Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (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 AECA1131E4F for ; Fri, 19 Apr 2024 09:49:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713520192; cv=none; b=SoyHXwhBazSXxClHLtpp9dgCBbXcqlcKJljhhsu4F4rps8PCTN0YmRrpKSzG2fdquQmJ1HuSb6Q5dtgIqDhPYi08hJPbn+EBObpmIfJZvQrOEAdmJ/gSDQqlbrhbFtOtp5cnP2CeGD7hcJ88Spa35KBL890fDiee56cyRV8v6MU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713520192; c=relaxed/simple; bh=17e3seaVPIolCVRnz9dvrXMTILwJmsuH1BK6VcvWdM0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lhTXK99bMswqKK7iiD14lWAivG19PAEj/H2z2CzSwzl663tFFvVYWN3vYA7TsY0D/gw4t/JsHILH1Vl2tw1ZxftaLQaSO0EXAs28by8OiWBOTZDOIjDvYR0VB7WkimxwNz8tbeY1gl6lEjpEtw0XlFz/l/8c2KPkXATYn7WxHGE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=ZuGUNop+; arc=none smtp.client-ip=209.85.222.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-78f05e56cb3so107464485a.1 for ; Fri, 19 Apr 2024 02:49:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713520190; x=1714124990; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=STqazHEagBxWlHC69lQFp5WbvQ2Sdx8rB6+uKcUB0cU=; b=ZuGUNop+tH0RgKocDXxkRsVvrnFasZvANqzDP7sflrJPFFUsa99CxGy6YdeSw9dE0Q nqbKRfp8ZCqtFkO7Qfoloi52OJnTlT79PnBwIwd8OPmT8ZYTH4Nmsnol+D3dWNNhuFAp HjSltF1Pp9wdOf7NKt3X4R/38ctkVkgVSO3Ro= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713520190; x=1714124990; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=STqazHEagBxWlHC69lQFp5WbvQ2Sdx8rB6+uKcUB0cU=; b=jit3LZW6gWAE5e6InLWcaHBjmLWBtYglmGr528cCFFIEDIniZEt+lQoU3j7PH2NdX1 OhpC6CVPD7SW83Q20J0JfGNENdzRpmQxtJW2VJ9sRiLJ54vflRBRPA97If+LDlciYWhz 6xBUz+U4o9pwuA/QFrjAczBNoqzwsygCKzsnjsKnJhrIpnNQQibdZ75WYeCU5blfuyt3 XbJW+0BTdoZvztdKnNLQHb7Gwpiq/wdvLDUIxeWdXa6uW275W+j5+tB9B1UGAfa5hH/A Nqk51rDTmMAKhjiFWrMoaglqI+ODmrQSonsdKMsFvTJyVS7tjKH9cRidEnsojpKKJ2r+ i2gw== X-Forwarded-Encrypted: i=1; AJvYcCX1lrLUbqeOCJIgppwnACz3+/EbTZL3eFyvx/LeWXQWqihlO3uHNU1D2G0eFwAHn86C14CVX8faDJvjosRRa8NjxhVREgpgq9FPKip5 X-Gm-Message-State: AOJu0Yyy7VoK3FohsKTlru7i/ZC9s8t8pe1oiKhhArsl1Sr06GKl7GC6 FScSaosZxApDPgqRAAyTQTjRiAP5UKYa/SXoXACmzMY8YXYjmoeid6oMEcPQpQ== X-Received: by 2002:ae9:f00d:0:b0:78e:fd3c:b6 with SMTP id l13-20020ae9f00d000000b0078efd3c00b6mr1503480qkg.40.1713520189085; Fri, 19 Apr 2024 02:49:49 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id dt14-20020a05620a478e00b0078d735ca917sm1434532qkb.123.2024.04.19.02.49.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:49:48 -0700 (PDT) From: Ricardo Ribalda Date: Fri, 19 Apr 2024 09:48:12 +0000 Subject: [PATCH v2 26/26] media: dvb-frontends: tda10048: Make explicit the range of z. 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="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240419-fix-cocci-v2-26-2119e692309c@chromium.org> References: <20240419-fix-cocci-v2-0-2119e692309c@chromium.org> In-Reply-To: <20240419-fix-cocci-v2-0-2119e692309c@chromium.org> To: Martin Tuma , Mauro Carvalho Chehab , 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 Cc: 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, Ricardo Ribalda X-Mailer: b4 0.12.4 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 */ z = 7 * sample_freq_hz; do_div(t, z); t += 5; -- 2.44.0.769.g3c40516874-goog