imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,19 +1,19 @@
 static void __init request_standard_resources(struct meminfo *mi) {
   struct resource *res;
   int i;
   kernel_code.start = virt_to_phys(_stext);
   kernel_code.end = virt_to_phys(_etext - 1);
   kernel_data.start = virt_to_phys(_sdata);
   kernel_data.end = virt_to_phys(_end - 1);
   for (i = 0; i < mi->nr_banks; i++) {
     if (mi->bank[i].size == 0) continue;
-    res = memblock_alloc_low(sizeof(*res), 0);
+    res = memblock_alloc_low(sizeof(*res), SMP_CACHE_BYTES);
     res->name = "System RAM";
     res->start = mi->bank[i].start;
     res->end = mi->bank[i].start + mi->bank[i].size - 1;
     res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
     request_resource(&iomem_resource, res);
     if (kernel_code.start >= res->start && kernel_code.end <= res->end) request_resource(res, &kernel_code);
     if (kernel_data.start >= res->start && kernel_data.end <= res->end) request_resource(res, &kernel_data);
   }
 }<sep>@@
expression size, min_addr, max_addr, nid;
@@
(
- memblock_alloc_try_nid_raw(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid_raw(size, SMP_CACHE_BYTES, min_addr, max_addr,nid)
|
- memblock_alloc_try_nid_nopanic(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid_nopanic(size, SMP_CACHE_BYTES, min_addr, max_addr,nid)
|
- memblock_alloc_try_nid(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid(size, SMP_CACHE_BYTES, min_addr, max_addr, nid)
|
- memblock_alloc(size, 0)
+ memblock_alloc(size, SMP_CACHE_BYTES)
|
- memblock_alloc_raw(size, 0)
+ memblock_alloc_raw(size, SMP_CACHE_BYTES)
|
- memblock_alloc_from(size, 0, min_addr)
+ memblock_alloc_from(size, SMP_CACHE_BYTES, min_addr)
|
- memblock_alloc_nopanic(size, 0)
+ memblock_alloc_nopanic(size, SMP_CACHE_BYTES)
|
- memblock_alloc_low(size, 0)
+ memblock_alloc_low(size, SMP_CACHE_BYTES)
|
- memblock_alloc_low_nopanic(size, 0)
+ memblock_alloc_low_nopanic(size, SMP_CACHE_BYTES)
|
- memblock_alloc_from_nopanic(size, 0, min_addr)
+ memblock_alloc_from_nopanic(size, SMP_CACHE_BYTES, min_addr)
|
- memblock_alloc_node(size, 0, nid)
+ memblock_alloc_node(size, SMP_CACHE_BYTES, nid)
)
--- initial
+++ final
@@ -1,34 +1,34 @@
 static void __init sn_init_pdas(char **cmdline_p) {
   cnodeid_t cnode;
   /*
    * Allocate & initialize the nodepda for each node.
    */
   for_each_online_node(cnode) {
-    nodepdaindr[cnode] = memblock_alloc_node(sizeof(nodepda_t), 0, cnode);
+    nodepdaindr[cnode] = memblock_alloc_node(sizeof(nodepda_t), SMP_CACHE_BYTES, cnode);
     memset(nodepdaindr[cnode]->phys_cpuid, -1, sizeof(nodepdaindr[cnode]->phys_cpuid));
     spin_lock_init(&nodepdaindr[cnode]->ptc_lock);
   }
   /*
    * Allocate & initialize nodepda for TIOs.  For now, put them on node 0.
    */
   for (cnode = num_online_nodes(); cnode < num_cnodes; cnode++)
-    nodepdaindr[cnode] = memblock_alloc_node(sizeof(nodepda_t), 0, 0);
+    nodepdaindr[cnode] = memblock_alloc_node(sizeof(nodepda_t), SMP_CACHE_BYTES, 0);
   /*
    * Now copy the array of nodepda pointers to each nodepda.
    */
   for (cnode = 0; cnode < num_cnodes; cnode++)
     memcpy(nodepdaindr[cnode]->pernode_pdaindr, nodepdaindr, sizeof(nodepdaindr));
   /*
    * Set up IO related platform-dependent nodepda fields.
    * The following routine actually sets up the hubinfo struct
    * in nodepda.
    */
   for_each_online_node(cnode) { bte_init_node(nodepdaindr[cnode], cnode); }
   /*
    * Initialize the per node hubdev.  This includes IO Nodes and
    * headless/memless nodes.
    */
   for (cnode = 0; cnode < num_cnodes; cnode++) {
     hubdev_init_node(nodepdaindr[cnode], cnode);
   }
 }<sep>@@
expression size, min_addr, max_addr, nid;
@@
(
- memblock_alloc_try_nid_raw(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid_raw(size, SMP_CACHE_BYTES, min_addr, max_addr,nid)
|
- memblock_alloc_try_nid_nopanic(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid_nopanic(size, SMP_CACHE_BYTES, min_addr, max_addr,nid)
|
- memblock_alloc_try_nid(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid(size, SMP_CACHE_BYTES, min_addr, max_addr, nid)
|
- memblock_alloc(size, 0)
+ memblock_alloc(size, SMP_CACHE_BYTES)
|
- memblock_alloc_raw(size, 0)
+ memblock_alloc_raw(size, SMP_CACHE_BYTES)
|
- memblock_alloc_from(size, 0, min_addr)
+ memblock_alloc_from(size, SMP_CACHE_BYTES, min_addr)
|
- memblock_alloc_nopanic(size, 0)
+ memblock_alloc_nopanic(size, SMP_CACHE_BYTES)
|
- memblock_alloc_low(size, 0)
+ memblock_alloc_low(size, SMP_CACHE_BYTES)
|
- memblock_alloc_low_nopanic(size, 0)
+ memblock_alloc_low_nopanic(size, SMP_CACHE_BYTES)
|
- memblock_alloc_from_nopanic(size, 0, min_addr)
+ memblock_alloc_from_nopanic(size, SMP_CACHE_BYTES, min_addr)
|
- memblock_alloc_node(size, 0, nid)
+ memblock_alloc_node(size, SMP_CACHE_BYTES, nid)
)
--- initial
+++ final
@@ -1,25 +1,25 @@
 void __init __register_nosave_region(unsigned long start_pfn, unsigned long end_pfn, int use_kmalloc) {
   struct nosave_region *region;
   if (start_pfn >= end_pfn) return;
   if (!list_empty(&nosave_regions)) {
     /* Try to extend the previous region (they should be sorted) */
     region = list_entry(nosave_regions.prev, struct nosave_region, list);
     if (region->end_pfn == start_pfn) {
       region->end_pfn = end_pfn;
       goto Report;
     }
   }
   if (use_kmalloc) {
     /* During init, this shouldn't fail */
     region = kmalloc(sizeof(struct nosave_region), GFP_KERNEL);
     BUG_ON(!region);
   } else {
     /* This allocation cannot fail */
-    region = memblock_alloc(sizeof(struct nosave_region), 0);
+    region = memblock_alloc(sizeof(struct nosave_region), SMP_CACHE_BYTES);
   }
   region->start_pfn = start_pfn;
   region->end_pfn = end_pfn;
   list_add_tail(&region->list, &nosave_regions);
 Report:
   pr_info("Registered nosave memory: [mem %#010llx-%#010llx]\n", (unsigned long long)start_pfn << PAGE_SHIFT, ((unsigned long long)end_pfn << PAGE_SHIFT) - 1);
 }<sep>@@
expression size, min_addr, max_addr, nid;
@@
(
- memblock_alloc_try_nid_raw(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid_raw(size, SMP_CACHE_BYTES, min_addr, max_addr,nid)
|
- memblock_alloc_try_nid_nopanic(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid_nopanic(size, SMP_CACHE_BYTES, min_addr, max_addr,nid)
|
- memblock_alloc_try_nid(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid(size, SMP_CACHE_BYTES, min_addr, max_addr, nid)
|
- memblock_alloc(size, 0)
+ memblock_alloc(size, SMP_CACHE_BYTES)
|
- memblock_alloc_raw(size, 0)
+ memblock_alloc_raw(size, SMP_CACHE_BYTES)
|
- memblock_alloc_from(size, 0, min_addr)
+ memblock_alloc_from(size, SMP_CACHE_BYTES, min_addr)
|
- memblock_alloc_nopanic(size, 0)
+ memblock_alloc_nopanic(size, SMP_CACHE_BYTES)
|
- memblock_alloc_low(size, 0)
+ memblock_alloc_low(size, SMP_CACHE_BYTES)
|
- memblock_alloc_low_nopanic(size, 0)
+ memblock_alloc_low_nopanic(size, SMP_CACHE_BYTES)
|
- memblock_alloc_from_nopanic(size, 0, min_addr)
+ memblock_alloc_from_nopanic(size, SMP_CACHE_BYTES, min_addr)
|
- memblock_alloc_node(size, 0, nid)
+ memblock_alloc_node(size, SMP_CACHE_BYTES, nid)
)
--- initial
+++ final
@@ -1,9 +1,9 @@
 mem_section __ref *sparse_index_alloc(int nid) {
   struct mem_section *section = NULL;
   unsigned long array_size = SECTIONS_PER_ROOT * sizeof(struct mem_section);
   if (slab_is_available())
     section = kzalloc_node(array_size, GFP_KERNEL, nid);
   else
-    section = memblock_alloc_node(array_size, 0, nid);
+    section = memblock_alloc_node(array_size, SMP_CACHE_BYTES, nid);
   return section;
 }<sep>@@
expression size, min_addr, max_addr, nid;
@@
(
- memblock_alloc_try_nid_raw(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid_raw(size, SMP_CACHE_BYTES, min_addr, max_addr,nid)
|
- memblock_alloc_try_nid_nopanic(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid_nopanic(size, SMP_CACHE_BYTES, min_addr, max_addr,nid)
|
- memblock_alloc_try_nid(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid(size, SMP_CACHE_BYTES, min_addr, max_addr, nid)
|
- memblock_alloc(size, 0)
+ memblock_alloc(size, SMP_CACHE_BYTES)
|
- memblock_alloc_raw(size, 0)
+ memblock_alloc_raw(size, SMP_CACHE_BYTES)
|
- memblock_alloc_from(size, 0, min_addr)
+ memblock_alloc_from(size, SMP_CACHE_BYTES, min_addr)
|
- memblock_alloc_nopanic(size, 0)
+ memblock_alloc_nopanic(size, SMP_CACHE_BYTES)
|
- memblock_alloc_low(size, 0)
+ memblock_alloc_low(size, SMP_CACHE_BYTES)
|
- memblock_alloc_low_nopanic(size, 0)
+ memblock_alloc_low_nopanic(size, SMP_CACHE_BYTES)
|
- memblock_alloc_from_nopanic(size, 0, min_addr)
+ memblock_alloc_from_nopanic(size, SMP_CACHE_BYTES, min_addr)
|
- memblock_alloc_node(size, 0, nid)
+ memblock_alloc_node(size, SMP_CACHE_BYTES, nid)
)
--- initial
+++ final
@@ -1,19 +1,19 @@
 void __init dvma_init(void) {
   struct hole *hole;
   int i;
   INIT_LIST_HEAD(&hole_list);
   INIT_LIST_HEAD(&hole_cache);
   /* prepare the hole cache */
   for (i = 0; i < 64; i++)
     list_add(&(initholes[i].list), &hole_cache);
   hole = rmcache();
   hole->start = DVMA_START;
   hole->end = DVMA_END;
   hole->size = DVMA_SIZE;
   list_add(&(hole->list), &hole_list);
-  iommu_use = memblock_alloc(IOMMU_TOTAL_ENTRIES * sizeof(unsigned long), 0);
+  iommu_use = memblock_alloc(IOMMU_TOTAL_ENTRIES * sizeof(unsigned long), SMP_CACHE_BYTES);
   dvma_unmap_iommu(DVMA_START, DVMA_SIZE);
 #ifdef CONFIG_SUN3
   sun3_dvma_init();
 #endif
 }<sep>@@
expression size, min_addr, max_addr, nid;
@@
(
- memblock_alloc_try_nid_raw(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid_raw(size, SMP_CACHE_BYTES, min_addr, max_addr,nid)
|
- memblock_alloc_try_nid_nopanic(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid_nopanic(size, SMP_CACHE_BYTES, min_addr, max_addr,nid)
|
- memblock_alloc_try_nid(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid(size, SMP_CACHE_BYTES, min_addr, max_addr, nid)
|
- memblock_alloc(size, 0)
+ memblock_alloc(size, SMP_CACHE_BYTES)
|
- memblock_alloc_raw(size, 0)
+ memblock_alloc_raw(size, SMP_CACHE_BYTES)
|
- memblock_alloc_from(size, 0, min_addr)
+ memblock_alloc_from(size, SMP_CACHE_BYTES, min_addr)
|
- memblock_alloc_nopanic(size, 0)
+ memblock_alloc_nopanic(size, SMP_CACHE_BYTES)
|
- memblock_alloc_low(size, 0)
+ memblock_alloc_low(size, SMP_CACHE_BYTES)
|
- memblock_alloc_low_nopanic(size, 0)
+ memblock_alloc_low_nopanic(size, SMP_CACHE_BYTES)
|
- memblock_alloc_from_nopanic(size, 0, min_addr)
+ memblock_alloc_from_nopanic(size, SMP_CACHE_BYTES, min_addr)
|
- memblock_alloc_node(size, 0, nid)
+ memblock_alloc_node(size, SMP_CACHE_BYTES, nid)
)
--- initial
+++ final
@@ -1,4 +1,4 @@
 void __init mmu_context_init(void) {
-  ia64_ctx.bitmap = memblock_alloc((ia64_ctx.max_ctx + 1) >> 3, 0);
-  ia64_ctx.flushmap = memblock_alloc((ia64_ctx.max_ctx + 1) >> 3, 0);
+  ia64_ctx.bitmap = memblock_alloc((ia64_ctx.max_ctx + 1) >> 3, SMP_CACHE_BYTES);
+  ia64_ctx.flushmap = memblock_alloc((ia64_ctx.max_ctx + 1) >> 3, SMP_CACHE_BYTES);
 }<sep>@@
expression size, min_addr, max_addr, nid;
@@
(
- memblock_alloc_try_nid_raw(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid_raw(size, SMP_CACHE_BYTES, min_addr, max_addr,nid)
|
- memblock_alloc_try_nid_nopanic(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid_nopanic(size, SMP_CACHE_BYTES, min_addr, max_addr,nid)
|
- memblock_alloc_try_nid(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid(size, SMP_CACHE_BYTES, min_addr, max_addr, nid)
|
- memblock_alloc(size, 0)
+ memblock_alloc(size, SMP_CACHE_BYTES)
|
- memblock_alloc_raw(size, 0)
+ memblock_alloc_raw(size, SMP_CACHE_BYTES)
|
- memblock_alloc_from(size, 0, min_addr)
+ memblock_alloc_from(size, SMP_CACHE_BYTES, min_addr)
|
- memblock_alloc_nopanic(size, 0)
+ memblock_alloc_nopanic(size, SMP_CACHE_BYTES)
|
- memblock_alloc_low(size, 0)
+ memblock_alloc_low(size, SMP_CACHE_BYTES)
|
- memblock_alloc_low_nopanic(size, 0)
+ memblock_alloc_low_nopanic(size, SMP_CACHE_BYTES)
|
- memblock_alloc_from_nopanic(size, 0, min_addr)
+ memblock_alloc_from_nopanic(size, SMP_CACHE_BYTES, min_addr)
|
- memblock_alloc_node(size, 0, nid)
+ memblock_alloc_node(size, SMP_CACHE_BYTES, nid)
)
--- initial
+++ final
@@ -1,16 +1,16 @@
 static int __init vector_setup(char *str) {
   char *error;
   int n, err;
   struct vector_cmd_line_arg *new;
   err = vector_parse(str, &n, &str, &error);
   if (err) {
     printk(KERN_ERR "vector_setup - Couldn't parse '%s' : %s\n", str, error);
     return 1;
   }
-  new = memblock_alloc(sizeof(*new), 0);
+  new = memblock_alloc(sizeof(*new), SMP_CACHE_BYTES);
   INIT_LIST_HEAD(&new->list);
   new->unit = n;
   new->arguments = str;
   list_add_tail(&new->list, &vec_cmd_line);
   return 1;
 }<sep>@@
expression size, min_addr, max_addr, nid;
@@
(
- memblock_alloc_try_nid_raw(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid_raw(size, SMP_CACHE_BYTES, min_addr, max_addr,nid)
|
- memblock_alloc_try_nid_nopanic(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid_nopanic(size, SMP_CACHE_BYTES, min_addr, max_addr,nid)
|
- memblock_alloc_try_nid(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid(size, SMP_CACHE_BYTES, min_addr, max_addr, nid)
|
- memblock_alloc(size, 0)
+ memblock_alloc(size, SMP_CACHE_BYTES)
|
- memblock_alloc_raw(size, 0)
+ memblock_alloc_raw(size, SMP_CACHE_BYTES)
|
- memblock_alloc_from(size, 0, min_addr)
+ memblock_alloc_from(size, SMP_CACHE_BYTES, min_addr)
|
- memblock_alloc_nopanic(size, 0)
+ memblock_alloc_nopanic(size, SMP_CACHE_BYTES)
|
- memblock_alloc_low(size, 0)
+ memblock_alloc_low(size, SMP_CACHE_BYTES)
|
- memblock_alloc_low_nopanic(size, 0)
+ memblock_alloc_low_nopanic(size, SMP_CACHE_BYTES)
|
- memblock_alloc_from_nopanic(size, 0, min_addr)
+ memblock_alloc_from_nopanic(size, SMP_CACHE_BYTES, min_addr)
|
- memblock_alloc_node(size, 0, nid)
+ memblock_alloc_node(size, SMP_CACHE_BYTES, nid)
)
--- initial
+++ final
@@ -1,18 +1,18 @@
 static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn) {
   const size_t nd_size = roundup(sizeof(pg_data_t), SMP_CACHE_BYTES);
   u64 nd_pa;
   void *nd;
   int tnid;
   if (start_pfn >= end_pfn) pr_info("Initmem setup node %d [<memory-less node>]\n", nid);
-  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 = end_pfn - start_pfn;
 }<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_aligned(unsigned long sz, unsigned long align) {
-  void *ptr = __va(memblock_alloc(sz, align));
+  void *ptr = __va(memblock_phys_alloc(sz, align));
   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,9 +1,9 @@
 struct save_area *__init save_area_alloc(bool is_boot_cpu) {
   struct save_area *sa;
-  sa = (void *)memblock_alloc(sizeof(*sa), 8);
+  sa = (void *)memblock_phys_alloc(sizeof(*sa), 8);
   if (is_boot_cpu)
     list_add(&sa->list, &dump_save_areas);
   else
     list_add_tail(&sa->list, &dump_save_areas);
   return sa;
 }<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,19 +1,19 @@
 static void allocate_dart(void) {
   unsigned long tmp;
   /* 512 pages (2MB) is max DART tablesize. */
   dart_tablesize = 1UL << 21;
   /*
    * 16MB (1 << 24) alignment. We allocate a full 16Mb chuck since we
    * will blow up an entire large page anyway in the kernel mapping.
    */
   dart_tablebase = __va(memblock_alloc_base(1UL << 24, 1UL << 24, 0x80000000L));
   /* There is no point scanning the DART space for leaks*/
   kmemleak_no_scan((void *)dart_tablebase);
   /* Allocate a spare page to map all invalid DART pages. We need to do
    * that to work around what looks like a problem with the HT bridge
    * prefetching into invalid pages and corrupting data
    */
-  tmp = memblock_alloc(DART_PAGE_SIZE, DART_PAGE_SIZE);
+  tmp = memblock_phys_alloc(DART_PAGE_SIZE, DART_PAGE_SIZE);
   dart_emptyval = DARTMAP_VALID | ((tmp >> DART_PAGE_SHIFT) & DARTMAP_RPNMASK);
   printk(KERN_INFO "DART table allocated at: %p\n", dart_tablebase);
 }<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,13 +1,13 @@
 void __init coherent_mem_init(phys_addr_t start, u32 size) {
   phys_addr_t bitmap_phys;
   if (!size) return;
   printk(KERN_INFO "Coherent memory (DMA) region start=0x%x size=0x%x\n", start, size);
   dma_base = start;
   dma_size = size;
   /* allocate bitmap */
   dma_pages = dma_size >> PAGE_SHIFT;
   if (dma_size & (PAGE_SIZE - 1)) ++dma_pages;
-  bitmap_phys = memblock_alloc(BITS_TO_LONGS(dma_pages) * sizeof(long), sizeof(long));
+  bitmap_phys = memblock_phys_alloc(BITS_TO_LONGS(dma_pages) * sizeof(long), sizeof(long));
   dma_bitmap = phys_to_virt(bitmap_phys);
   memset(dma_bitmap, 0, dma_pages * 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,31 +1,31 @@
 static int __init dt_cpu_ftrs_scan_callback(unsigned long node, const char *uname, int depth, void *data) {
   const __be32 *prop;
   int count, i;
   u32 isa;
   /* We are scanning "ibm,powerpc-cpu-features" nodes only */
   if (!of_flat_dt_is_compatible(node, "ibm,powerpc-cpu-features")) return 0;
   prop = of_get_flat_dt_prop(node, "isa", NULL);
   if (!prop) /* We checked before, "can't happen" */
     return 0;
   isa = be32_to_cpup(prop);
   /* Count and allocate space for cpu features */
   of_scan_flat_dt_subnodes(node, count_cpufeatures_subnodes, &nr_dt_cpu_features);
-  dt_cpu_features = __va(memblock_alloc(sizeof(struct dt_cpu_feature) * nr_dt_cpu_features, PAGE_SIZE));
+  dt_cpu_features = __va(memblock_phys_alloc(sizeof(struct dt_cpu_feature) * nr_dt_cpu_features, PAGE_SIZE));
   cpufeatures_setup_start(isa);
   /* Scan nodes into dt_cpu_features and enable those without deps  */
   count = 0;
   of_scan_flat_dt_subnodes(node, scan_cpufeatures_subnodes, &count);
   /* Recursive enable remaining features with dependencies */
   for (i = 0; i < nr_dt_cpu_features; i++) {
     struct dt_cpu_feature *f = &dt_cpu_features[i];
     cpufeatures_deps_enable(f);
   }
   prop = of_get_flat_dt_prop(node, "display-name", NULL);
   if (prop && strlen((char *)prop) != 0) {
     strlcpy(dt_cpu_name, (char *)prop, sizeof(dt_cpu_name));
     cur_cpu_spec->cpu_name = dt_cpu_name;
   }
   cpufeatures_setup_finished();
   memblock_free(__pa(dt_cpu_features), sizeof(struct dt_cpu_feature) * nr_dt_cpu_features);
   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,19 +1,19 @@
 static void __init allocate_node_data(int nid) {
   struct pglist_data *p;
   unsigned long start_pfn, end_pfn;
 #ifdef CONFIG_NEED_MULTIPLE_NODES
   unsigned long paddr;
-  paddr = memblock_alloc_try_nid(sizeof(struct pglist_data), SMP_CACHE_BYTES, nid);
+  paddr = memblock_phys_alloc_try_nid(sizeof(struct pglist_data), SMP_CACHE_BYTES, nid);
   if (!paddr) {
     prom_printf("Cannot allocate pglist_data for nid[%d]\n", nid);
     prom_halt();
   }
   NODE_DATA(nid) = __va(paddr);
   memset(NODE_DATA(nid), 0, sizeof(struct pglist_data));
   NODE_DATA(nid)->node_id = nid;
 #endif
   p = NODE_DATA(nid);
   get_pfn_range_for_nid(nid, &start_pfn, &end_pfn);
   p->node_start_pfn = start_pfn;
   p->node_spanned_pages = end_pfn - start_pfn;
 }<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,30 +1,30 @@
 static int __init grab_mblocks(struct mdesc_handle *md) {
   unsigned long paddr;
   int count = 0;
   u64 node;
   mdesc_for_each_node_by_name(md, node, "mblock") count++;
   if (!count) return -ENOENT;
-  paddr = memblock_alloc(count * sizeof(struct mdesc_mblock), SMP_CACHE_BYTES);
+  paddr = memblock_phys_alloc(count * sizeof(struct mdesc_mblock), SMP_CACHE_BYTES);
   if (!paddr) return -ENOMEM;
   mblocks = __va(paddr);
   num_mblocks = count;
   count = 0;
   mdesc_for_each_node_by_name(md, node, "mblock") {
     struct mdesc_mblock *m = &mblocks[count++];
     const u64 *val;
     val = mdesc_get_property(md, node, "base", NULL);
     m->base = *val;
     val = mdesc_get_property(md, node, "size", NULL);
     m->size = *val;
     val = mdesc_get_property(md, node, "address-congruence-offset", NULL);
     /* The address-congruence-offset property is optional.
      * Explicity zero it be identifty this.
      */
     if (val)
       m->offset = *val;
     else
       m->offset = 0UL;
     numadbg("MBLOCK[%d]: base[%llx] size[%llx] offset[%llx]\n", count - 1, m->base, m->size, m->offset);
   }
   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,27 +1,27 @@
 static int __init grab_mlgroups(struct mdesc_handle *md) {
   unsigned long paddr;
   int count = 0;
   u64 node;
   mdesc_for_each_node_by_name(md, node, "memory-latency-group") count++;
   if (!count) return -ENOENT;
-  paddr = memblock_alloc(count * sizeof(struct mdesc_mlgroup), SMP_CACHE_BYTES);
+  paddr = memblock_phys_alloc(count * sizeof(struct mdesc_mlgroup), SMP_CACHE_BYTES);
   if (!paddr) return -ENOMEM;
   mlgroups = __va(paddr);
   num_mlgroups = count;
   count = 0;
   mdesc_for_each_node_by_name(md, node, "memory-latency-group") {
     struct mdesc_mlgroup *m = &mlgroups[count++];
     const u64 *val;
     m->node = node;
     val = mdesc_get_property(md, node, "latency", NULL);
     m->latency = *val;
     val = mdesc_get_property(md, node, "address-match", NULL);
     m->match = *val;
     val = mdesc_get_property(md, node, "address-mask", NULL);
     m->mask = *val;
     numadbg("MLGROUP[%d]: node[%llx] latency[%llx] "
             "match[%llx] mask[%llx]\n",
             count - 1, m->node, m->latency, m->match, m->mask);
   }
   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)
)