Skip to content

Commit

Permalink
xen-dom-mgmt: Use DIV_ROUND_UP instead of ceiling_fraction
Browse files Browse the repository at this point in the history
ceiling_fraction is deprecated and should be replaced with DIV_ROUND_UP.

Signed-off-by: Mykyta Poturai <[email protected]>
  • Loading branch information
Deedone committed Feb 27, 2024
1 parent 6284247 commit 14ceb8a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xen-dom-mgmt/src/xen-dom-mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static int prepare_domain_physmap(int domid, uint64_t base_pfn, struct xen_domai
int rc;
uint64_t populated_gfn;
uint64_t nr_mem_exts =
ceiling_fraction(cfg->mem_kb * 1024, PFN_2M_SIZE);
DIV_ROUND_UP(cfg->mem_kb * 1024, PFN_2M_SIZE);

rc = allocate_magic_pages(domid);
if (rc) {
Expand Down Expand Up @@ -319,7 +319,7 @@ static int load_dtb(int domid, uint64_t dtb_addr, const char *dtb_start,
void *mapped_dtb_addr;
int rc, err_cache_flush = 0;
uint64_t dtb_size = dtb_end - dtb_start;
uint64_t nr_pages = ceiling_fraction(dtb_size, XEN_PAGE_SIZE);
uint64_t nr_pages = DIV_ROUND_UP(dtb_size, XEN_PAGE_SIZE);
uint64_t dtb_pfn;

rc = xenmem_map_region(domid, nr_pages,
Expand Down Expand Up @@ -402,7 +402,7 @@ static int probe_zimage(int domid, uint64_t base_addr,
return rc;
}

nr_pages = ceiling_fraction(domain_size, XEN_PAGE_SIZE);
nr_pages = DIV_ROUND_UP(domain_size, XEN_PAGE_SIZE);
LOG_DBG("zImage header info: text_offset = %llx, base_addr = %llx, pages = %llu size = %llu",
zhdr.text_offset, base_addr, nr_pages,
nr_pages * XEN_PAGE_SIZE);
Expand Down

0 comments on commit 14ceb8a

Please sign in to comment.