Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

phy: freescale: fsl-samsung-hdmi: Stop searching when exact match is found

There are a series of for-loops which check various values of P and S
for the integer divder PLL. The for loops search all entries and use
the one closest to the nominal, but it continues to searches through
all for loops even after the nominal is achieved. Ending when the
nominal value is found stops wasting time, since it will not find
a better value than a deviation of 0 Hz.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Link: https://lore.kernel.org/r/20241026132014.73050-2-aford173@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Adam Ford and committed by
Vinod Koul
1b9b8b15 2a9868d6

+5 -1
+5 -1
drivers/phy/freescale/phy-fsl-samsung-hdmi.c
··· 440 440 min_delta = delta; 441 441 best_freq = tmp; 442 442 } 443 + 444 + /* If we have an exact match, stop looking for a better value */ 445 + if (!delta) 446 + goto done; 443 447 } 444 448 } 445 - 449 + done: 446 450 if (best_freq) { 447 451 *p = best_p; 448 452 *m = best_m;