diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2020-07-07 10:31:56 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-12-07 15:49:32 +0100 |
commit | 482e75e7b3eba6730cbfaa1911916d13887c9606 (patch) | |
tree | c522a03b0601df1de45141f49e6def813a1bcee7 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | fe52ece8d2e26bd4d38e2c99a7cd13d944c1ee98 (diff) |
media: ccs-pll: Avoid overflow in pre-PLL divisor lower bound search
The external clock frequency times the PLL multiplier may exceed the value
range of 32-bit unsigned integers. Instead perform the same calculation y
using two divisions.
The result has some potential to be different, but that's ok: this number
is used to limit the range of pre-PLL divisors to find optimal values. So
the effect of the rare case of a different result here would mean an
invalid pre-PLL divisor is tried. That will be found out a little later in
any case.
Also guard against dividing by zero if the external clock frequency is
higher than the maximum OP PLL output clock --- a rather improbable case.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions