From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 01F02F9E8; Tue, 16 Jul 2024 15:41:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721144506; cv=none; b=topSqcpkBRUw8TUyRIIDPsRRKMcQaM4Kk3WhLLoko+wC5tSaCeOs6zffbNr1XrMWK4flrHbtANLrcJD9lLXi+qeAf/TSYGfFqA5MTOv1vC+LWjJGVux4Tr7xqndd3ORQGMCAqbH21Wr4IZ0VKg2MBICLm54IZfEI4ln7Oyuai0U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721144506; c=relaxed/simple; bh=Ri3snXcuHeNrXgl13bmiQRWns0Z173d6fFlOV7QHfD0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F8IdqmelGLpy4Kh2UbsJEAMJCD+mOC//zuGsR3s5dxSRqs2xm9Pf50AykD0RFH6zvfntFcJkW90MkjyiehgtuFU/ikx2mhOMa6vQYU3fDESP/EW5RTmFdfisSQJ+GN3QohR/bAx2tNTyRV7l60HTZ5T8mikK3utlfaWGI00a8YU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1OH/bp3H; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="1OH/bp3H" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71788C116B1; Tue, 16 Jul 2024 15:41:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1721144505; bh=Ri3snXcuHeNrXgl13bmiQRWns0Z173d6fFlOV7QHfD0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1OH/bp3HXrl1/nAClVOBrPIa7I1hQUuCqojaUE+mun1yFG3VnXjcxeUPiGUWhsSgF P06Y8wdZ/PyklXQwUH4ZEBk9xd7XY6+vsOOT9vkrGqPeHQnIrrJJKoIvTivtgzIMsr 5Bb78y4jl4/RY7S8Q3AFb72hcyGOB0NIt0zRjI9M= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ricardo Ribalda , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.10 016/108] media: dvb-frontends: tda18271c2dd: Remove casting during div Date: Tue, 16 Jul 2024 17:30:31 +0200 Message-ID: <20240716152746.621983000@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240716152745.988603303@linuxfoundation.org> References: <20240716152745.988603303@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ricardo Ribalda [ Upstream commit e9a844632630e18ed0671a7e3467431bd719952e ] 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. Link: https://lore.kernel.org/linux-media/20240429-fix-cocci-v3-8-3c4865f5a4b0@chromium.org Signed-off-by: Ricardo Ribalda Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- 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 a348344879433..fd928787207ed 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; -- 2.43.0