From patchwork Mon Apr 29 15:04:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13647156 Return-Path: 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 365F3C04FFE for ; Mon, 29 Apr 2024 15:06:30 +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=YMcsnzBd93Ou3WahTrZkr6ZVQ4hryPLp64xuQzJu7Ms=; b=DuQ4T/KNfvGvQV f5TfRv4i/0EdEMdSh/Kt4Bi3bypj6u+uWl7AStEKWIm5Fd2UAu6wEy926QrlyeC7FQ2K56saqcwTB mjH0N2WN6w2Zedzwd737nRtacg2ZSwFqZNAPqUY+7l7kXCESB/Q4iCUzkI91RCXN+nk12aL9p+G+W 89/RVt/5mqufHxY1hwV3CakRQfif0RBVesBkgjN0lEsPIn/CPVJfDitpfdcZrCKM3YY+6AVirsydV 12xkAU6X9vrIo1VD391wLoJ3CASYXDO3WheAsEKa/qdjmwEiQeuo7Flx5stEi8vPAzXGqWXWBz5w5 UBRmWhclYdRJwYetFgvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1Sa7-00000003GAw-28ZI; Mon, 29 Apr 2024 15:06:15 +0000 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1SYm-00000003FM9-2dyh for linux-arm-kernel@lists.infradead.org; Mon, 29 Apr 2024 15:04:55 +0000 Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-790ff1fa7b3so45286385a.2 for ; Mon, 29 Apr 2024 08:04:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714403092; x=1715007892; 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=OI4AOi/6PtgU5zRnLUWjMVWmm8Y+CckVMvMt6qKhGc0=; b=dx1iybqQ/4aokzR+fbQuOsC9+OxRzHc6i8TPA0sbt4nVwbEfkovf4PkzQTos6xRbJs P67IzcMQp9J9OjQaYmbNnOpTp+oayGC6VlvHAobipvdazY6JP4zSoI3EW2AnngAW7RY2 unAe9MXRPuUrM/jFw85/x0/yf2lSFn8TWpihU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714403092; x=1715007892; 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=OI4AOi/6PtgU5zRnLUWjMVWmm8Y+CckVMvMt6qKhGc0=; b=ZhFTKiMGH4lsMdOt91QHgsv/beX9vDBbgPi7bP9wrX1AacNkaaxk85PxvVZ/RE4OAP umf2czbf97Q8Y3PdOU9xe4vVim+b/EE3R/1tDnsuyS68RzkmM8pkveqHABDk2Oh0cXi8 jtxse+h6WpzhQdvggUkr8FiPN7ufke2Ru+DJ7piOsA/JAfEjlrcs816L7tWckVaVWXkk 8dZzkFghCWauxYChskVBnVIoaSUOAt5P4cuGrrgXfRDQoLh7B5okjqAUfHxTV7RuQWpA bOvG825aKtXExq4S4gqhDBQwEPMDkd0WqxMcs5hJYEl8k7YP6AKLcjr/ojrYhyf044TX ntHA== X-Forwarded-Encrypted: i=1; AJvYcCWzEFr8S7rJPTmsAhKk31ELnIGHOAgUu9wGf1kyRhgQRDjgW6hB9b76kHD4R+wBCSbtp3T26AZb/bubWjaZBnjWF6E9CmfrvGCxiegRfmyY5y+lgSQ= X-Gm-Message-State: AOJu0YxkvnmqjnnfB6ycV+IIIkxNU0YbTu5e/X2MAqU0ak5OK15qXYMy Iw5AnJ3pQPPmsF8btDyOEF7CLpxSUX2J1HOYJl0m0ZXJFXoL76lFxqVn9Wh5PQ== X-Google-Smtp-Source: AGHT+IG3TSxma0YdxDVyjt+TwA8E2r3YjCQOsUMIKvXlCmNNngt83Fx59gwPuYEOR/mAqhiKqgMwqA== X-Received: by 2002:a05:620a:2445:b0:790:f04b:328c with SMTP id h5-20020a05620a244500b00790f04b328cmr4582245qkn.29.1714403091343; Mon, 29 Apr 2024 08:04:51 -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 p7-20020a05620a056700b0078d3b9139edsm10568591qkp.97.2024.04.29.08.04.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 08:04:51 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 29 Apr 2024 15:04:47 +0000 Subject: [PATCH v3 08/26] media: dvb-frontends: tda18271c2dd: Remove casting during div MIME-Version: 1.0 Message-Id: <20240429-fix-cocci-v3-8-3c4865f5a4b0@chromium.org> References: <20240429-fix-cocci-v3-0-3c4865f5a4b0@chromium.org> In-Reply-To: <20240429-fix-cocci-v3-0-3c4865f5a4b0@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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240429_080452_989253_9406978F X-CRM114-Status: GOOD ( 13.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org do_div() divides 64 bits by 32. We were adding a casting to the divider to 64 bits, for a number that fits perfectly in 32 bits. Remove it. Found by cocci: drivers/media/dvb-frontends/tda18271c2dd.c:355:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_u64 instead. drivers/media/dvb-frontends/tda18271c2dd.c:331: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/tda18271c2dd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb-frontends/tda18271c2dd.c b/drivers/media/dvb-frontends/tda18271c2dd.c index a34834487943..fd928787207e 100644 --- a/drivers/media/dvb-frontends/tda18271c2dd.c +++ b/drivers/media/dvb-frontends/tda18271c2dd.c @@ -328,7 +328,7 @@ static int CalcMainPLL(struct tda_state *state, u32 freq) OscFreq = (u64) freq * (u64) Div; OscFreq *= (u64) 16384; - do_div(OscFreq, (u64)16000000); + do_div(OscFreq, 16000000); MainDiv = OscFreq; state->m_Regs[MPD] = PostDiv & 0x77; @@ -352,7 +352,7 @@ static int CalcCalPLL(struct tda_state *state, u32 freq) OscFreq = (u64)freq * (u64)Div; /* CalDiv = u32( OscFreq * 16384 / 16000000 ); */ OscFreq *= (u64)16384; - do_div(OscFreq, (u64)16000000); + do_div(OscFreq, 16000000); CalDiv = OscFreq; state->m_Regs[CPD] = PostDiv;