imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,42 +1,42 @@
 static void __init map_ram(void) {
   unsigned long v, p, e;
   pgprot_t prot;
   pgd_t *pge;
   pud_t *pue;
   pmd_t *pme;
   pte_t *pte;
   /* These mark extents of read-only kernel pages...
    * ...from vmlinux.lds.S
    */
   struct memblock_region *region;
   v = PAGE_OFFSET;
   for_each_memblock(memory, region) {
     p = (u32)region->base & PAGE_MASK;
     e = p + (u32)region->size;
     v = (u32)__va(p);
     pge = pgd_offset_k(v);
     while (p < e) {
       int j;
       pue = pud_offset(pge, v);
       pme = pmd_offset(pue, v);
       if ((u32)pue != (u32)pge || (u32)pme != (u32)pge) {
         panic("%s: OR1K kernel hardcoded for "
               "two-level page tables",
               __func__);
       }
       /* Alloc one page for holding PTE's... */
-      pte = (pte_t *)__va(memblock_alloc(PAGE_SIZE, PAGE_SIZE));
+      pte = (pte_t *)__va(memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE));
       set_pmd(pme, __pmd(_KERNPG_TABLE + __pa(pte)));
       /* Fill the newly allocated page with PTE'S */
       for (j = 0; p < e && j < PTRS_PER_PTE; v += PAGE_SIZE, p += PAGE_SIZE, j++, pte++) {
         if (v >= (u32)_e_kernel_ro || v < (u32)_s_kernel_ro)
           prot = PAGE_KERNEL;
         else
           prot = PAGE_KERNEL_RO;
         set_pte(pte, mk_pte_phys(p, prot));
       }
       pge++;
     }
     printk(KERN_INFO "%s: Memory: 0x%x-0x%x\n", __func__, region->base, region->base + region->size);
   }
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,35 +1,35 @@
 static int __init iob_init(struct device_node *dn) {
   unsigned long tmp;
   u32 regword;
   int i;
   pr_debug(" -> %s\n", __func__);
   /* For 2G space, 8x64 pages (2^21 bytes) is max total l2 size */
   iob_l2_base = (u32 *)__va(memblock_alloc_base(1UL << 21, 1UL << 21, 0x80000000));
   pr_info("IOBMAP L2 allocated at: %p\n", iob_l2_base);
   /* Allocate a spare page to map all invalid IOTLB pages. */
-  tmp = memblock_alloc(IOBMAP_PAGE_SIZE, IOBMAP_PAGE_SIZE);
+  tmp = memblock_phys_alloc(IOBMAP_PAGE_SIZE, IOBMAP_PAGE_SIZE);
   if (!tmp) panic("IOBMAP: Cannot allocate spare page!");
   /* Empty l1 is marked invalid */
   iob_l1_emptyval = 0;
   /* Empty l2 is mapped to dummy page */
   iob_l2_emptyval = IOBMAP_L2E_V | (tmp >> IOBMAP_PAGE_SHIFT);
   iob = ioremap(IOB_BASE, IOB_SIZE);
   if (!iob) panic("IOBMAP: Cannot map registers!");
   /* setup direct mapping of the L1 entries */
   for (i = 0; i < 64; i++) {
     /* Each L1 covers 32MB, i.e. 8K entries = 32K of ram */
     regword = IOBMAP_L1E_V | (__pa(iob_l2_base + i * 0x2000) >> 12);
     out_le32(iob + IOB_XLT_L1_REGBASE + i * 4, regword);
   }
   /* set 2GB translation window, based at 0 */
   regword = in_le32(iob + IOB_AD_REG);
   regword &= ~IOB_AD_TRNG_MASK;
   regword |= IOB_AD_TRNG_2G;
   out_le32(iob + IOB_AD_REG, regword);
   /* Enable translation */
   regword = in_le32(iob + IOBCOM_REG);
   regword |= IOBCOM_ATEN;
   out_le32(iob + IOBCOM_REG, regword);
   pr_debug(" <- %s\n", __func__);
   return 0;
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,10 +1,10 @@
 pte_t __ref *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) {
   pte_t *pte;
   if (likely(mem_init_done)) {
     pte = (pte_t *)__get_free_page(GFP_KERNEL);
   } else {
-    pte = (pte_t *)__va(memblock_alloc(PAGE_SIZE, PAGE_SIZE));
+    pte = (pte_t *)__va(memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE));
   }
   if (pte) clear_page(pte);
   return pte;
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,14 +1,14 @@
 static struct mdesc_handle *__init mdesc_memblock_alloc(unsigned int mdesc_size) {
   unsigned int handle_size, alloc_size;
   struct mdesc_handle *hp;
   unsigned long paddr;
   handle_size = (sizeof(struct mdesc_handle) - sizeof(struct mdesc_hdr) + mdesc_size);
   alloc_size = PAGE_ALIGN(handle_size);
-  paddr = memblock_alloc(alloc_size, PAGE_SIZE);
+  paddr = memblock_phys_alloc(alloc_size, PAGE_SIZE);
   hp = NULL;
   if (paddr) {
     hp = __va(paddr);
     mdesc_handle_init(hp, handle_size, hp);
   }
   return hp;
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,5 +1,5 @@
 phys_addr_t __init memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, int nid) {
-  phys_addr_t res = memblock_alloc_nid(size, align, nid);
+  phys_addr_t res = memblock_phys_alloc_nid(size, align, nid);
   if (res) return res;
   return memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ACCESSIBLE);
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1 +1 @@
-static phys_addr_t __init __efi_memmap_alloc_early(unsigned long size) { return memblock_alloc(size, 0); }
+static phys_addr_t __init __efi_memmap_alloc_early(unsigned long size) { return memblock_phys_alloc(size, 0); }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,32 +1,32 @@
 static void __init fixedrange_init(void) {
   unsigned long vaddr;
   pgd_t *pgd;
   pud_t *pud;
   pmd_t *pmd;
 #ifdef CONFIG_HIGHMEM
   pte_t *pte;
 #endif /* CONFIG_HIGHMEM */
   /*
    * Fixed mappings:
    */
   vaddr = __fix_to_virt(__end_of_fixed_addresses - 1);
   pgd = swapper_pg_dir + pgd_index(vaddr);
   pud = pud_offset(pgd, vaddr);
   pmd = pmd_offset(pud, vaddr);
-  fixmap_pmd_p = (pmd_t *)__va(memblock_alloc(PAGE_SIZE, PAGE_SIZE));
+  fixmap_pmd_p = (pmd_t *)__va(memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE));
   memset(fixmap_pmd_p, 0, PAGE_SIZE);
   set_pmd(pmd, __pmd(__pa(fixmap_pmd_p) + _PAGE_KERNEL_TABLE));
 #ifdef CONFIG_HIGHMEM
   /*
    * Permanent kmaps:
    */
   vaddr = PKMAP_BASE;
   pgd = swapper_pg_dir + pgd_index(vaddr);
   pud = pud_offset(pgd, vaddr);
   pmd = pmd_offset(pud, vaddr);
-  pte = (pte_t *)__va(memblock_alloc(PAGE_SIZE, PAGE_SIZE));
+  pte = (pte_t *)__va(memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE));
   memset(pte, 0, PAGE_SIZE);
   set_pmd(pmd, __pmd(__pa(pte) + _PAGE_KERNEL_TABLE));
   pkmap_page_table = pte;
 #endif /* CONFIG_HIGHMEM */
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,35 +1,35 @@
 static void __init map_ram(void) {
   unsigned long v, p, e;
   pgd_t *pge;
   pud_t *pue;
   pmd_t *pme;
   pte_t *pte;
   /* These mark extents of read-only kernel pages...
    * ...from vmlinux.lds.S
    */
   p = (u32)memblock_start_of_DRAM() & PAGE_MASK;
   e = min((u32)memblock_end_of_DRAM(), (u32)__pa(high_memory));
   v = (u32)__va(p);
   pge = pgd_offset_k(v);
   while (p < e) {
     int j;
     pue = pud_offset(pge, v);
     pme = pmd_offset(pue, v);
     if ((u32)pue != (u32)pge || (u32)pme != (u32)pge) {
       panic("%s: Kernel hardcoded for "
             "two-level page tables",
             __func__);
     }
     /* Alloc one page for holding PTE's... */
-    pte = (pte_t *)__va(memblock_alloc(PAGE_SIZE, PAGE_SIZE));
+    pte = (pte_t *)__va(memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE));
     memset(pte, 0, PAGE_SIZE);
     set_pmd(pme, __pmd(__pa(pte) + _PAGE_KERNEL_TABLE));
     /* Fill the newly allocated page with PTE'S */
     for (j = 0; p < e && j < PTRS_PER_PTE; v += PAGE_SIZE, p += PAGE_SIZE, j++, pte++) {
       /* Create mapping between p and v. */
       /* TODO: more fine grant for page access permission */
       set_pte(pte, __pte(p + pgprot_val(PAGE_KERNEL)));
     }
     pge++;
   }
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,16 +1,16 @@
 void __init paging_init(void) {
   int i;
   void *zero_page;
   pr_info("Setting up paging and PTEs.\n");
   /* clear out the init_mm.pgd that will contain the kernel's mappings */
   for (i = 0; i < PTRS_PER_PGD; i++)
     swapper_pg_dir[i] = __pgd(1);
   map_ram();
   fixedrange_init();
   /* allocate space for empty_zero_page */
-  zero_page = __va(memblock_alloc(PAGE_SIZE, PAGE_SIZE));
+  zero_page = __va(memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE));
   memset(zero_page, 0, PAGE_SIZE);
   zone_sizes_init();
   empty_zero_page = virt_to_page(zero_page);
   flush_dcache_page(empty_zero_page);
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,18 +1,18 @@
 static phys_addr_t __init early_pgtable_alloc(void) {
   phys_addr_t phys;
   void *ptr;
-  phys = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
+  phys = memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE);
   /*
    * The FIX_{PGD,PUD,PMD} slots may be in active use, but the FIX_PTE
    * slot will be free, so we can (ab)use the FIX_PTE slot to initialise
    * any level of table.
    */
   ptr = pte_set_fixmap(phys);
   memset(ptr, 0, PAGE_SIZE);
   /*
    * Implicit barriers also ensure the zeroed page is visible to the page
    * table walker
    */
   pte_clear_fixmap();
   return phys;
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,18 +1,18 @@
 static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn) {
   u64 spanned_pages = end_pfn - start_pfn;
   const size_t nd_size = roundup(sizeof(pg_data_t), SMP_CACHE_BYTES);
   u64 nd_pa;
   void *nd;
   int tnid;
-  nd_pa = memblock_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid);
+  nd_pa = memblock_phys_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid);
   nd = __va(nd_pa);
   /* report and initialize */
   pr_info("  NODE_DATA [mem %#010Lx-%#010Lx]\n", nd_pa, nd_pa + nd_size - 1);
   tnid = early_pfn_to_nid(nd_pa >> PAGE_SHIFT);
   if (tnid != nid) pr_info("    NODE_DATA(%d) on node %d\n", nid, tnid);
   node_data[nid] = nd;
   memset(NODE_DATA(nid), 0, sizeof(pg_data_t));
   NODE_DATA(nid)->node_id = nid;
   NODE_DATA(nid)->node_start_pfn = start_pfn;
   NODE_DATA(nid)->node_spanned_pages = spanned_pages;
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,5 +1,5 @@
 static void __init *early_alloc(unsigned long sz) {
-  void *ptr = __va(memblock_alloc(sz, sz));
+  void *ptr = __va(memblock_phys_alloc(sz, sz));
   memset(ptr, 0, sz);
   return ptr;
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,26 +1,26 @@
 static void __init alloc_node_data(int nid) {
   const size_t nd_size = roundup(sizeof(pg_data_t), PAGE_SIZE);
   u64 nd_pa;
   void *nd;
   int tnid;
   /*
    * Allocate node data.  Try node-local memory and then any node.
    * Never allocate in DMA zone.
    */
-  nd_pa = memblock_alloc_nid(nd_size, SMP_CACHE_BYTES, nid);
+  nd_pa = memblock_phys_alloc_nid(nd_size, SMP_CACHE_BYTES, nid);
   if (!nd_pa) {
     nd_pa = __memblock_alloc_base(nd_size, SMP_CACHE_BYTES, MEMBLOCK_ALLOC_ACCESSIBLE);
     if (!nd_pa) {
       pr_err("Cannot find %zu bytes in any node (initial node: %d)\n", nd_size, nid);
       return;
     }
   }
   nd = __va(nd_pa);
   /* report and initialize */
   printk(KERN_INFO "NODE_DATA(%d) allocated [mem %#010Lx-%#010Lx]\n", nid, nd_pa, nd_pa + nd_size - 1);
   tnid = early_pfn_to_nid(nd_pa >> PAGE_SHIFT);
   if (tnid != nid) printk(KERN_INFO "    NODE_DATA(%d) on node %d\n", nid, tnid);
   node_data[nid] = nd;
   memset(NODE_DATA(nid), 0, sizeof(pg_data_t));
   node_set_online(nid);
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,6 +1,6 @@
 static __init pg_data_t *alloc_node_data(void) {
   pg_data_t *res;
-  res = (pg_data_t *)memblock_alloc(sizeof(pg_data_t), 8);
+  res = (pg_data_t *)memblock_phys_alloc(sizeof(pg_data_t), 8);
   memset(res, 0, sizeof(pg_data_t));
   return res;
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,32 +1,32 @@
 int __init early_init_dt_scan_recoverable_ranges(unsigned long node, const char *uname, int depth, void *data) {
   int i, psize, size;
   const __be32 *prop;
   if (depth != 1 || strcmp(uname, "ibm,opal") != 0) return 0;
   prop = of_get_flat_dt_prop(node, "mcheck-recoverable-ranges", &psize);
   if (!prop) return 1;
   pr_debug("Found machine check recoverable ranges.\n");
   /*
    * Calculate number of available entries.
    *
    * Each recoverable address range entry is (start address, len,
    * recovery address), 2 cells each for start and recovery address,
    * 1 cell for len, totalling 5 cells per entry.
    */
   mc_recoverable_range_len = psize / (sizeof(*prop) * 5);
   /* Sanity check */
   if (!mc_recoverable_range_len) return 1;
   /* Size required to hold all the entries. */
   size = mc_recoverable_range_len * sizeof(struct mcheck_recoverable_range);
   /*
    * Allocate a buffer to hold the MC recoverable ranges.
    */
-  mc_recoverable_range = __va(memblock_alloc(size, __alignof__(u64)));
+  mc_recoverable_range = __va(memblock_phys_alloc(size, __alignof__(u64)));
   memset(mc_recoverable_range, 0, size);
   for (i = 0; i < mc_recoverable_range_len; i++) {
     mc_recoverable_range[i].start_addr = of_read_number(prop + (i * 5) + 0, 2);
     mc_recoverable_range[i].end_addr = mc_recoverable_range[i].start_addr + of_read_number(prop + (i * 5) + 2, 1);
     mc_recoverable_range[i].recover_addr = of_read_number(prop + (i * 5) + 3, 2);
     pr_debug("Machine check recoverable range: %llx..%llx: %llx\n", mc_recoverable_range[i].start_addr, mc_recoverable_range[i].end_addr, mc_recoverable_range[i].recover_addr);
   }
   return 1;
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,6 +1,6 @@
 void __init allocate_paca_ptrs(void) {
   paca_nr_cpu_ids = nr_cpu_ids;
   paca_ptrs_size = sizeof(struct paca_struct *) * nr_cpu_ids;
-  paca_ptrs = __va(memblock_alloc(paca_ptrs_size, 0));
+  paca_ptrs = __va(memblock_phys_alloc(paca_ptrs_size, 0));
   memset(paca_ptrs, 0x88, paca_ptrs_size);
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,10 +1,10 @@
 __ref pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) {
   pte_t *pte;
   if (slab_is_available()) {
     pte = (pte_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
   } else {
-    pte = __va(memblock_alloc(PAGE_SIZE, PAGE_SIZE));
+    pte = __va(memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE));
     if (pte) clear_page(pte);
   }
   return pte;
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,12 +1,12 @@
 void *__init prom_early_alloc(unsigned long size) {
-  unsigned long paddr = memblock_alloc(size, SMP_CACHE_BYTES);
+  unsigned long paddr = memblock_phys_alloc(size, SMP_CACHE_BYTES);
   void *ret;
   if (!paddr) {
     prom_printf("prom_early_alloc(%lu) failed\n", size);
     prom_halt();
   }
   ret = __va(paddr);
   memset(ret, 0, size);
   prom_early_allocated += size;
   return ret;
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,14 +1,14 @@
 static void __init move_device_tree(void) {
   unsigned long start, size;
   void *p;
   DBG("-> move_device_tree\n");
   start = __pa(initial_boot_params);
   size = fdt_totalsize(initial_boot_params);
   if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) || overlaps_crashkernel(start, size) || overlaps_initrd(start, size)) {
-    p = __va(memblock_alloc(size, PAGE_SIZE));
+    p = __va(memblock_phys_alloc(size, PAGE_SIZE));
     memcpy(p, initial_boot_params, size);
     initial_boot_params = p;
     DBG("Moved device tree to 0x%p\n", p);
   }
   DBG("<- move_device_tree\n");
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,17 +1,17 @@
 void __init exc_lvl_early_init(void) {
   unsigned int i, hw_cpu;
   /* interrupt stacks must be in lowmem, we get that for free on ppc32
    * as the memblock is limited to lowmem by MEMBLOCK_REAL_LIMIT */
   for_each_possible_cpu(i) {
 #ifdef CONFIG_SMP
     hw_cpu = get_hard_smp_processor_id(i);
 #else
     hw_cpu = 0;
 #endif
-    critirq_ctx[hw_cpu] = (struct thread_info *)__va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
+    critirq_ctx[hw_cpu] = (struct thread_info *)__va(memblock_phys_alloc(THREAD_SIZE, THREAD_SIZE));
 #ifdef CONFIG_BOOKE
-    dbgirq_ctx[hw_cpu] = (struct thread_info *)__va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
-    mcheckirq_ctx[hw_cpu] = (struct thread_info *)__va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
+    dbgirq_ctx[hw_cpu] = (struct thread_info *)__va(memblock_phys_alloc(THREAD_SIZE, THREAD_SIZE));
+    mcheckirq_ctx[hw_cpu] = (struct thread_info *)__va(memblock_phys_alloc(THREAD_SIZE, THREAD_SIZE));
 #endif
   }
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,9 +1,9 @@
 void __init irqstack_early_init(void) {
   unsigned int i;
   /* interrupt stacks must be in lowmem, we get that for free on ppc32
    * as the memblock is limited to lowmem by default */
   for_each_possible_cpu(i) {
-    softirq_ctx[i] = (struct thread_info *)__va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
-    hardirq_ctx[i] = (struct thread_info *)__va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
+    softirq_ctx[i] = (struct thread_info *)__va(memblock_phys_alloc(THREAD_SIZE, THREAD_SIZE));
+    hardirq_ctx[i] = (struct thread_info *)__va(memblock_phys_alloc(THREAD_SIZE, THREAD_SIZE));
   }
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,6 +1,6 @@
 static void __init setup_randomness(void) {
   struct sysinfo_3_2_2 *vmms;
-  vmms = (struct sysinfo_3_2_2 *)memblock_alloc(PAGE_SIZE, PAGE_SIZE);
+  vmms = (struct sysinfo_3_2_2 *)memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE);
   if (stsi(vmms, 3, 2, 2) == 0 && vmms->count) add_device_randomness(&vmms->vm, sizeof(vmms->vm[0]) * vmms->count);
   memblock_free((unsigned long)vmms, PAGE_SIZE);
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,5 +1,5 @@
 static void __ref *vmem_alloc_pages(unsigned int order) {
   unsigned long size = PAGE_SIZE << order;
   if (slab_is_available()) return (void *)__get_free_pages(GFP_KERNEL, order);
-  return (void *)memblock_alloc(size, size);
+  return (void *)memblock_phys_alloc(size, size);
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,11 +1,11 @@
 pte_t __ref *vmem_pte_alloc(void) {
   unsigned long size = PTRS_PER_PTE * sizeof(pte_t);
   pte_t *pte;
   if (slab_is_available())
     pte = (pte_t *)page_table_alloc(&init_mm);
   else
-    pte = (pte_t *)memblock_alloc(size, size);
+    pte = (pte_t *)memblock_phys_alloc(size, size);
   if (!pte) return NULL;
   memset64((u64 *)pte, _PAGE_INVALID, PTRS_PER_PTE);
   return pte;
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)
--- initial
+++ final
@@ -1,9 +1,9 @@
 void *__ref zalloc_maybe_bootmem(size_t size, gfp_t mask) {
   void *p;
   if (slab_is_available())
     p = kzalloc(size, mask);
   else {
-    p = memblock_virt_alloc(size, 0);
+    p = memblock_alloc(size, 0);
   }
   return p;
 }<sep>@@
expression e1,e2;
@@

-                       memblock_virt_alloc
+                       memblock_alloc
				(e1,e2)
--- initial
+++ final
@@ -1,4 +1,4 @@
 static phys_addr_t __init kasan_alloc_zeroed_page(int node) {
-  void *p = memblock_virt_alloc_try_nid(PAGE_SIZE, PAGE_SIZE, __pa(MAX_DMA_ADDRESS), MEMBLOCK_ALLOC_ACCESSIBLE, node);
+  void *p = memblock_alloc_try_nid(PAGE_SIZE, PAGE_SIZE, __pa(MAX_DMA_ADDRESS), MEMBLOCK_ALLOC_ACCESSIBLE, node);
   return __pa(p);
 }<sep>@@
expression e1,e2,e3,e4,e5;
@@

-       memblock_virt_alloc_try_nid
+       memblock_alloc_try_nid
		(e1,e2,e3,e4,e5)