Message ID | 20240415-fix-cocci-v1-22-477afb23728b@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 0DE60C4345F for <linux-arm-kernel@archiver.kernel.org>; Mon, 15 Apr 2024 19:38:26 +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=rM0avj3cbwHUkeXRc7XmCJn/ZjmJxQQBzythnncSOQM=; b=qin4tUsHToeTbD 7Z8gPMZjifPJnvcE5rodq443ytZAdxIfhxZ4enzGfpo9RQfMkh1ZVmMppGciMjDL+8EAHTjuWIbaJ 1FVwVBMYmJbSeTJS3tRZRaNQGj++UgLK9PkoV99DPcc7iS1rBzOTiHyaKcEsAFYUT+EQbooYW4KAV cfFZRKOuneByMg1nbQ/dUhbm9sIZxYHY4+zROAyRSf2gb2RvExIZ4EcsH9vcXwJtBe7FOk5rO53Yv oWKm8/LCbbYBSOkjI9IMUq1gKYFjSvDXKFmCGaHt2BGkjQCk9l2t4nZCHxOjYyi/E18eeDgbMQs3I TbwcMk4CxOp2Xg0j4KfQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS9d-00000009e6S-2wxt; Mon, 15 Apr 2024 19:38:13 +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 1rwS6Z-00000009cIK-1x1N for linux-arm-kernel@bombadil.infradead.org; Mon, 15 Apr 2024 19:35:03 +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=/qWsKtiTtM68cPujZgkDbgLJScEQ/KU6IejvF8XzFy8=; b=AV6bJTuvtAFMBo15aW8TqaiiNA D8pCiwRKU1VeJqUAPRkZleS9LYgBZLH4+5fdZflryd3i3EyatB/S4HBz5gmkiAn1JH/naQT0+E1iH kumGsAqX4yeqaE7n7P72c5WF72PeYtVTBK09zREEYjqvnivLGWNOGNEwucmVzSMlbzGGuUqxp8Ngs +fqS2DOqPC1gLZuQ0tEchDcZ9CDWsmhnu6nrY/MaODES6u+jEjvAx7FhdQjhzb4E1Vw0seWb1gqVE EVVcT5wNfMKTYWQ5IdltYEEOyWlHI5G8fDv1oODwejr47b/ASea1VWt3tpnPDXlIHFfyyLgh11/Hm 9SMPjlWQ==; Received: from mail-qk1-x72d.google.com ([2607:f8b0:4864:20::72d]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwS6T-0000000AikE-2C8w for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 19:35:01 +0000 Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-78d57bd5781so264773185a.3 for <linux-arm-kernel@lists.infradead.org>; Mon, 15 Apr 2024 12:34:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713209693; x=1713814493; 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=/qWsKtiTtM68cPujZgkDbgLJScEQ/KU6IejvF8XzFy8=; b=UQl6QrNmDvjwcTQk48q73CKd3hLujSZQ+IxoKPgzbZOjAYirqFIjUTtl2b00piEcRX vUpWXNbIeIbI36yxaBksWPgirMiHEZJNAbF97UNubO1xIM0QoQwsu2lOXsyJtZjFZFo0 h4dTcZHw1s6/20RDc+wBHOs4nd40DJUGsxG0w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713209693; x=1713814493; 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=/qWsKtiTtM68cPujZgkDbgLJScEQ/KU6IejvF8XzFy8=; b=UQroD9JI+5m2kbjhAfn59XuYxkFVwIrSV9c5CbSN9KE8fSiEuxNH2W/LYT4oE0W1RR GTOKRL73xeYEtKcCUg+Ti2URKI8cNSqSEZ19FMkQ8Xlbv+qZBpyP6zjcv8d07MUgfwDj fEfBy3ARzycV50S5luLQmZistgOItVtnA+TtnGDfdR9XllD90JhzDk0p6xkCJTx7r8Te rxDx7QlqCHYIXb1wAVL2Xz9vcMWy+NfYikrtWays5buo3zGwT5lBRhEQQK6XbRkVuQsu cgmuyeJJFDYfPGN6i58fE0BAiXgm7If9ekYfjw2ZnoIcU+RoYCw6QfaaJsIsV+Z6UcVk ZzXg== X-Forwarded-Encrypted: i=1; AJvYcCXIVIgBP1ynSC1tM2gEvbEcEdJRgtbgyoRroEmc+Tc1UtuiUI264vcqLTKoBRxc3Bdfa0vTdutuEQwm1VBWLsO1Ig/JHVty4T/AAoXtrWrtYr7ynG8= X-Gm-Message-State: AOJu0YxS/BRx+w3beQbRf+CatYW9VKIrcZ3FPGIfcIOW+e6VPe+1888c l9S7oEzRaHSVPwHlan2kFls0rgzDJf6uFOpjBt+7zuqisPIU+t1iQnpKDEl0VA== X-Google-Smtp-Source: AGHT+IE7tE6n2LOOWlxUIvgFNmo/Vr0dYpoxwwqjlaXwS/vDwhHd4c5esyFK2/v/y9hDaMP9p/kqqQ== X-Received: by 2002:a05:620a:410a:b0:78e:f439:64ee with SMTP id j10-20020a05620a410a00b0078ef43964eemr19862qko.72.1713209693277; Mon, 15 Apr 2024 12:34:53 -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 s26-20020ae9f71a000000b0078d3b54eb76sm6718055qkg.78.2024.04.15.12.34.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 12:34:52 -0700 (PDT) From: Ricardo Ribalda <ribalda@chromium.org> Date: Mon, 15 Apr 2024 19:34:39 +0000 Subject: [PATCH 22/35] media: i2c: st-mipid02: Use the correct div function MIME-Version: 1.0 Message-Id: <20240415-fix-cocci-v1-22-477afb23728b@chromium.org> References: <20240415-fix-cocci-v1-0-477afb23728b@chromium.org> In-Reply-To: <20240415-fix-cocci-v1-0-477afb23728b@chromium.org> To: Martin Tuma <martin.tuma@digiteqautomotive.com>, Mauro Carvalho Chehab <mchehab@kernel.org>, Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Hans Verkuil <hverkuil-cisco@xs4all.nl>, 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>, 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>, Benjamin Mugnier <benjamin.mugnier@foss.st.com>, Sylvain Petinot <sylvain.petinot@foss.st.com>, Jacopo Mondi <jacopo+renesas@jmondi.org>, Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>, Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>, =?utf-8?q?Ni?= =?utf-8?q?klas_S=C3=B6derlund?= <niklas.soderlund+renesas@ragnatech.se>, Pavel Machek <pavel@ucw.cz> 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-20240415_203458_435046_35E2FA7E X-CRM114-Status: GOOD ( 13.02 ) 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
|
Hi Ricardo, Thanks a lot. Reviewed-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> On 4/15/24 21:34, Ricardo Ribalda wrote: > link_freq does not fit in 32 bits. > > Found by cocci: > drivers/media/i2c/st-mipid02.c:329:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_s64 instead. > > Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> > --- > drivers/media/i2c/st-mipid02.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c > index f250640729ca..93a40bfda1af 100644 > --- a/drivers/media/i2c/st-mipid02.c > +++ b/drivers/media/i2c/st-mipid02.c > @@ -326,7 +326,7 @@ static int mipid02_configure_from_rx_speed(struct mipid02_dev *bridge, > } > > dev_dbg(&client->dev, "detect link_freq = %lld Hz", link_freq); > - do_div(ui_4, link_freq); > + ui_4 = div64_s64(ui_4, link_freq); > bridge->r.clk_lane_reg1 |= ui_4 << 2; > > return 0; >
diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c index f250640729ca..93a40bfda1af 100644 --- a/drivers/media/i2c/st-mipid02.c +++ b/drivers/media/i2c/st-mipid02.c @@ -326,7 +326,7 @@ static int mipid02_configure_from_rx_speed(struct mipid02_dev *bridge, } dev_dbg(&client->dev, "detect link_freq = %lld Hz", link_freq); - do_div(ui_4, link_freq); + ui_4 = div64_s64(ui_4, link_freq); bridge->r.clk_lane_reg1 |= ui_4 << 2; return 0;
link_freq does not fit in 32 bits. Found by cocci: drivers/media/i2c/st-mipid02.c:329:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_s64 instead. Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> --- drivers/media/i2c/st-mipid02.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)