Skip to content

Commit

Permalink
pmdalinux: use matching int types in hv-balloon (covscan)
Browse files Browse the repository at this point in the history
  • Loading branch information
natoscott committed Jul 5, 2024
1 parent 331fbfa commit 29e2661
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pmdas/linux/sysfs_kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,9 @@ refresh_sysfs_kernel(sysfs_kernel_t *sk, int *need_refresh)
else if (strcmp(name, "total_pages_committed") == 0)
sk->hv_balloon_total_committed = value;
}
value = sk->hv_balloon_pagesize ? /* fallback to kernel pagesize */
sk->hv_balloon_pagesize : (1 << _pm_pageshift);
value = sk->hv_balloon_pagesize ? /* local kernel fallback */
sk->hv_balloon_pagesize : /* avoids divide-by-zero */
(unsigned long long) (1 << _pm_pageshift);
sk->hv_balloon_added *= value;
sk->hv_balloon_onlined *= value;
sk->hv_balloon_ballooned *= value;
Expand Down

0 comments on commit 29e2661

Please sign in to comment.