Missing brackets when normalizing ipc-ratio

Add brackets to get the correct order of operation when calculating
ipc-ratios.

Bug=b:389714233
Test: ./tools/presubmit
Change-Id: I3284e16e1f1f0080ad829ab3053e0b2e5d78e931
Signed-off-by: David Dai <davidai@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6180532
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
David Dai 2025-01-17 00:05:06 +00:00 committed by crosvm LUCI
parent dcce6620dc
commit fe82dbdde7

View file

@ -1424,10 +1424,10 @@ fn setup_vm_components(cfg: &Config) -> Result<VmComponents> {
for (cpu_id, max_freq) in max_freqs.iter().enumerate() {
let normalized_cpu_ipc_ratio =
u64::from(*cfg.cpu_ipc_ratio.get(&cpu_id).unwrap_or(&1024))
* u64::from(*max_freq)
.checked_div(u64::from(*largest_host_max_freq))
.ok_or(Error::new(libc::EINVAL))?;
(u64::from(*cfg.cpu_ipc_ratio.get(&cpu_id).unwrap_or(&1024))
* u64::from(*max_freq))
.checked_div(u64::from(*largest_host_max_freq))
.ok_or(Error::new(libc::EINVAL))?;
normalized_cpu_ipc_ratios.insert(
cpu_id,
u32::try_from(normalized_cpu_ipc_ratio)