From patchwork Fri Apr 19 09:47:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13636098 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 8FD25C4345F for ; Fri, 19 Apr 2024 09:52:36 +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=shItScG8slTO/e IWvWq2hnlBxJnGYnaCRpWLlxFOvekHWvmD7+xhD1MmoII3gbvFIjhAa/lLUDf18YROpEcMlzNUW2z E69btcM7Kka0+73NScQfoZGUAAY4A3J/OW3fcjyEpwjSUWK5V9NxvCOKFr+DlXl54RPIlPXIqWqvx 2TQcbkJdd+u0KHWIL5QRwoyw5f9xsyNBhGSFjBvY+58cXTFMITC+zR0ahCk1f3GRmVyxjKO/9vhhn gGwp4U4uFWsd9AK8iQ/LaDGa+u5cxSGPLUQIi456nXulESl8KkVvgSNRVBRDQkZkVmLvolFk7cCbd qkNt59HHM/rN3GNgajLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxkup-00000005Abe-35Cj; Fri, 19 Apr 2024 09:52:19 +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 1rxksP-000000059CD-31vR for linux-arm-kernel@bombadil.infradead.org; Fri, 19 Apr 2024 09:49:49 +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=OI4AOi/6PtgU5zRnLUWjMVWmm8Y+CckVMvMt6qKhGc0=; b=MJn4pbKb0dYQcAJkCQT152EYde szq9WX75/hsjyCmy/RoCepEBXEeP64xq3Hm2VMMi+Tacwn1ewN/d0A5ZPJcFUr6XHZGH2sFWg3UqB QLypwW7N3sEoZD2+e2ELH7C62zwAjGYhNBBwdsan2QzFWgwEMv2DNoO+UdLqCtcZzdw0+9KFTGBZd y2z+zpe5MEuC4U7FOhEcOM/TsOzObgyrCZBnplw/FfQ8qMHOTpH5MQzLh1P8fbaJj3hhDfyT4hpiJ OpWb3GN2s/gRCxY2xViPPBzLDob529BWegkzkHh+cHfPEdJUuL1091UITJ2Cc5j5Tr3qfIJJckQpc M2FE4Dlw==; Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxksG-0000000COP7-3KWG for linux-arm-kernel@lists.infradead.org; Fri, 19 Apr 2024 09:49:48 +0000 Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6eb7a0b3fe7so1118009a34.2 for ; Fri, 19 Apr 2024 02:49:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713520169; x=1714124969; 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=K2NrA282RPrQYhc2MWT6QS1716yrp9wybzQ6wF/RWEPqE5z0J8RutkMJIaDm1VM9Xa qXfTT4cIVYKUxpiPFkbJlpvp2LdOTyuorRWNQdanDmlg3IBN1lVVVDEjMr8svPT1kGwQ pnfOb4lXgVVxO7JC61uJeEGqeb49tzI6PLYwU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713520169; x=1714124969; 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=lnop+n3T0OaMBgrRRJVTTt3jNzPeei7cTIKzzzzDvw3Mpddgcz9n8RQlw/ikIGDm2P GgMUzIH+BuyiF4qEcOVBPdvNrpChKsS5J/DU8FrDgV6namIRHS+7MF7mlQeVzbN+b3P3 8RSz57fxBJ2Airaak9ji3CIiGpU+6uzQbkkSAOzNYsnWgzDOXa28WSr92suzjbbDTAY8 aYvSlHK8yb0V8Vm5KvRgNHTSXaFbnBn8MeuffLhVbJA0QQ1h6Ita/XITvDOuCtOcTgaM IdqcNCAnHZAwa3O+bLAJoyRl36SSg9eCgjKM8hTMHkZcQ+svDm1LxSAQxu2cPancX+8g jVFw== X-Forwarded-Encrypted: i=1; AJvYcCXaeQ7EfaQOh51y4IccS7HltHCtGw5+BU/SLzsDeO2uedqreFY7uBPgmAcLdryr5G5dTRSGcmJxdaCbM4bCbXTuIRzylWyCgdPl7TvJNBh20FcN5cU= X-Gm-Message-State: AOJu0YwXP6jxIs0aILrAhQzgeJvKEbRxHL0G8ZJX9rE/oBPrQAIYCE84 pEJ/ncspYgBWa6/dPLIp53V517grE6evtxn4Zn4x1mAfFbYFDG+DDTVLmsDRKw== X-Google-Smtp-Source: AGHT+IEoa3EBjJC9669xc6mPVpvtJwhrzrmUgput3DoBfmRttNa6KJF0gCcMfSkwX6iyc+U8a8TeQg== X-Received: by 2002:a05:6830:1d48:b0:6eb:7a07:8746 with SMTP id p8-20020a0568301d4800b006eb7a078746mr1521944oth.31.1713520169041; Fri, 19 Apr 2024 02:49:29 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:49:28 -0700 (PDT) From: Ricardo Ribalda Date: Fri, 19 Apr 2024 09:47:54 +0000 Subject: [PATCH v2 08/26] media: dvb-frontends: tda18271c2dd: Remove casting during div MIME-Version: 1.0 Message-Id: <20240419-fix-cocci-v2-8-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240419_104943_043525_8B6FAA2F X-CRM114-Status: GOOD ( 13.10 ) 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;