linux-phy.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] phy: freescale: fsl-samsung-hdmi: Fix 64-by-32 division cocci warnings
@ 2024-12-15 22:05 Adam Ford
  2024-12-24 15:21 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Adam Ford @ 2024-12-15 22:05 UTC (permalink / raw)
  To: linux-phy
  Cc: aford, Adam Ford, kernel test robot, Vinod Koul,
	Kishon Vijay Abraham I, Frieder Schrempf, Dominique Martinet,
	linux-kernel

The Kernel test robot returns the following warning:
 do_div() does a 64-by-32 division, please consider using div64_ul instead.

To prevent the 64-by-32 divsion, consolidate both the multiplication
and the do_div into one line which explicitly uses u64 sizes.

Fixes: 1951dbb41d1d ("phy: freescale: fsl-samsung-hdmi: Support dynamic integer")
Signed-off-by: Adam Ford <aford173@gmail.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202412091243.fSObwwPi-lkp@intel.com/

diff --git a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
index 2c8038864357..d3ccf547ba1c 100644
--- a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
+++ b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
@@ -424,8 +424,7 @@ static unsigned long fsl_samsung_hdmi_phy_find_pms(unsigned long fout, u8 *p, u1
 			 * Fvco = (M * f_ref) / P,
 			 * where f_ref is 24MHz.
 			 */
-			tmp = (u64)_m * 24 * MHZ;
-			do_div(tmp, _p);
+			tmp = div64_ul((u64)_m * 24 * MHZ, _p);
 			if (tmp < 750 * MHZ ||
 			    tmp > 3000 * MHZ)
 				continue;
-- 
2.45.2


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] phy: freescale: fsl-samsung-hdmi: Fix 64-by-32 division cocci warnings
  2024-12-15 22:05 [PATCH] phy: freescale: fsl-samsung-hdmi: Fix 64-by-32 division cocci warnings Adam Ford
@ 2024-12-24 15:21 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2024-12-24 15:21 UTC (permalink / raw)
  To: linux-phy, Adam Ford
  Cc: aford, kernel test robot, Kishon Vijay Abraham I,
	Frieder Schrempf, Dominique Martinet, linux-kernel


On Sun, 15 Dec 2024 16:05:55 -0600, Adam Ford wrote:
> The Kernel test robot returns the following warning:
>  do_div() does a 64-by-32 division, please consider using div64_ul instead.
> 
> To prevent the 64-by-32 divsion, consolidate both the multiplication
> and the do_div into one line which explicitly uses u64 sizes.
> 
> 
> [...]

Applied, thanks!

[1/1] phy: freescale: fsl-samsung-hdmi: Fix 64-by-32 division cocci warnings
      commit: 739214dd1c209e34323814fb815fb17cccb9f95b

Best regards,
-- 
~Vinod



-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-24 15:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-15 22:05 [PATCH] phy: freescale: fsl-samsung-hdmi: Fix 64-by-32 division cocci warnings Adam Ford
2024-12-24 15:21 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).