mirror of https://github.com/torvalds/linux.git
PM / devfreq: tegra30: use min to simplify actmon_cpu_to_emc_rate
Use min() to improve the readability of actmon_cpu_to_emc_rate() and remove any unnecessary curly braces. Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Link: https://patchwork.kernel.org/project/linux-pm/patch/20251112172121.3741-2-thorsten.blum@linux.dev/
This commit is contained in:
parent
26dd44a400
commit
dc30fe7a0a
|
|
@ -13,6 +13,7 @@
|
|||
#include <linux/interrupt.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/minmax.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
|
@ -325,14 +326,9 @@ static unsigned long actmon_cpu_to_emc_rate(struct tegra_devfreq *tegra,
|
|||
unsigned int i;
|
||||
const struct tegra_actmon_emc_ratio *ratio = actmon_emc_ratios;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(actmon_emc_ratios); i++, ratio++) {
|
||||
if (cpu_freq >= ratio->cpu_freq) {
|
||||
if (ratio->emc_freq >= tegra->max_freq)
|
||||
return tegra->max_freq;
|
||||
else
|
||||
return ratio->emc_freq;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < ARRAY_SIZE(actmon_emc_ratios); i++, ratio++)
|
||||
if (cpu_freq >= ratio->cpu_freq)
|
||||
return min(ratio->emc_freq, tegra->max_freq);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue