Message ID | 20240419-fix-cocci-v2-26-2119e692309c@chromium.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 00C4EC4345F for <linux-arm-kernel@archiver.kernel.org>; Fri, 19 Apr 2024 09:53:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bK30URgvbTbv/+6RC5dElcsAfzChmheMYFYS9URU3PE=; b=pqsNLN2fgMs7NT H6TeJ5OGVc0r2zyDEztJGRoLjvhACzB6dF1gn4UpcHK/wUsy7WXT26fuC0RkIJVnkhsvH1lHPKo+F GwnK/N5YoSfKW+D0hEk5zjZt+W7ejIykB/EgG3xj70uo20IrUw9J2ekZTvzUHp6v9rBp0oKY+wZ69 FAL4EIXfG+R9Zr8DIUkguBvDMw0ItgQNqV1Z27lLjVz0siOPA6dQIa4lbOhZikkY3Vu5B7TK/CdSh JL4Yik8mqbbaN5KrpJrM9W5WZi0Uy0mbRPsiVktjfjk06nOXZ4mQ8CPxNKH/MEAWt5dj+ObS+laqU lZSb0EvyBvpNFq0ksT+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxkwC-00000005BTA-2STj; Fri, 19 Apr 2024 09:53:44 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxksW-000000059Iq-1EsQ for linux-arm-kernel@bombadil.infradead.org; Fri, 19 Apr 2024 09:49:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=STqazHEagBxWlHC69lQFp5WbvQ2Sdx8rB6+uKcUB0cU=; b=DUNe83Fp9v9Z720So59i/GzYZz 1bMD55PSoGUItxpB7GRVBohiUYr6/uND2cRKpysv53KoEp4f422LjMzumndpBqb/0q5h2OgdpqKge AHPdBqYXsZSdL1F8/3nSPerwgTf+oaJ6rkoUExwnpb4u2MBW9cJthT7UEzloCDdqzxkk15XR1rPgD IIX1myBJpzGxeSdpRBWnWkmcoKEUO0zwRL/BW2GRnD7q3ygwJxBOO1ZI9H56qfJMfIx2AIM9q6ZC/ tLGLXSyItSD/8HThlauiCE1ws4bq8DblCbwAB+UEc/qw7FWYksS8Rxen89QrNM8sCK0ADK0/NiiRK E8AK7RMg==; Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxksS-0000000COUL-1UGD for linux-arm-kernel@lists.infradead.org; Fri, 19 Apr 2024 09:49:55 +0000 Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-78f05e56cb3so107464385a.1 for <linux-arm-kernel@lists.infradead.org>; Fri, 19 Apr 2024 02:49:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713520190; x=1714124990; darn=lists.infradead.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=XAU9ZmZeXGx7enTxKqJcgoZrGS+MI1WahPhypLf+qdS1d67iYRkMoPQNwB9IVEG/++ h15XnH5+o7C/XeN9O0nbpQTwkf+QGCKciUe8yfJwWdwwd7GaP+H75IsiLxISWQIXug/R 8seF6s/Ol01HHYDlQoSdZtvFQoCY96240ztnk= 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=nKeokubjB0pboYvNZpus+S/9CbquelDKRCJnenwVM6kXWRp/Wy9cqnW8328FZN2rFN es0vbB6C8CFNbCd/VuhR8sLTEc9lTAp7D3eoaUDcu2+lXoB07eLZUj6+oubeCSh7qCuS Ib0mTDLffY8whjrz6669YVEAnXX/0Qka0kEDPNWca1am2kBRTk4X3ph4jmurGKu1rwS+ Gt8ldfqLfSguckTCFCKbAOrQ+kO5EUeCg0O+KuRXRyuVLnr0a/Ml9s7SaoNdf+NmYoGs EeUYKK/WXvby8wwpB8ed86YdWubLg0zLnOE4WvYGJvQqUcRkI2KogAmT2JFeqxVZ4o1c TZRA== X-Forwarded-Encrypted: i=1; AJvYcCVKtgTyVhato9EVTReymjNVI6PWy2l8Aj4ryTNJqQUk3ze4uAXIrjypoU/aijRwv5DiYkOt7x46sn+Rf1TKuS+SRVh/7ewbCzpvyAut9+R6XApKsWU= X-Gm-Message-State: AOJu0Yxw+CM/FAE0Dufkw6qNfe+pO7AcsDTzSztWgDCw8OZSre/WSE2E pvpSg/r+h1N18StlRU9PXm6vC7JOyPXx6L2X/1aZ6W1fc7edD3fV+K8BVZwwOw== X-Google-Smtp-Source: AGHT+IGB4W3xcDVnLVL+1B0lbE5yrHeQCLWo5Y0evN+/+oC4NuGMNOIMrDzfkEb/6TpNH9rKrh/xtA== 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 <ribalda@chromium.org> Date: Fri, 19 Apr 2024 09:48:12 +0000 Subject: [PATCH v2 26/26] media: dvb-frontends: tda10048: Make explicit the range of z. MIME-Version: 1.0 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 <martin.tuma@digiteqautomotive.com>, Mauro Carvalho Chehab <mchehab@kernel.org>, Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Hugues Fruchet <hugues.fruchet@foss.st.com>, Alain Volmat <alain.volmat@foss.st.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, Paul Kocialkowski <paul.kocialkowski@bootlin.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Chen-Yu Tsai <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, Samuel Holland <samuel@sholland.org>, Sakari Ailus <sakari.ailus@linux.intel.com>, Thierry Reding <thierry.reding@gmail.com>, Jonathan Hunter <jonathanh@nvidia.com>, Sowjanya Komatineni <skomatineni@nvidia.com>, Luca Ceresoli <luca.ceresoli@bootlin.com>, Matthias Brugger <matthias.bgg@gmail.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Hans Verkuil <hverkuil@xs4all.nl>, Sergey Kozlov <serjk@netup.ru>, Abylay Ospan <aospan@netup.ru>, Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>, Dmitry Osipenko <digetx@gmail.com>, Benjamin Mugnier <benjamin.mugnier@foss.st.com>, Sylvain Petinot <sylvain.petinot@foss.st.com>, Stanimir Varbanov <stanimir.k.varbanov@gmail.com>, Vikash Garodia <quic_vgarodia@quicinc.com>, Bryan O'Donoghue <bryan.odonoghue@linaro.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org> 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 <ribalda@chromium.org> X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240419_104953_296480_4A908F22 X-CRM114-Status: GOOD ( 12.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
media: Fix coccinelle warning/errors
|
expand
|
> We do not expect the sample_freq to be over 613MHz.
Would the summary phrase “Make the range of z explicit” be more appropriate?
Regards,
Markus
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;
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 <ribalda@chromium.org> --- drivers/media/dvb-frontends/tda10048.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)