drm/i915/display/icl_dsi: Prefer drm_WARN_ON over WARN_ON
[linux-2.6-microblaze.git] / mm / memory_hotplug.c
index 635e8e2..fc0aad0 100644 (file)
@@ -304,12 +304,15 @@ static int check_hotplug_memory_addressable(unsigned long pfn,
  * add the new pages.
  */
 int __ref __add_pages(int nid, unsigned long pfn, unsigned long nr_pages,
-               struct mhp_restrictions *restrictions)
+               struct mhp_params *params)
 {
        const unsigned long end_pfn = pfn + nr_pages;
        unsigned long cur_nr_pages;
        int err;
-       struct vmem_altmap *altmap = restrictions->altmap;
+       struct vmem_altmap *altmap = params->altmap;
+
+       if (WARN_ON_ONCE(!params->pgprot.pgprot))
+               return -EINVAL;
 
        err = check_hotplug_memory_addressable(pfn, nr_pages);
        if (err)
@@ -1002,7 +1005,7 @@ static int online_memory_block(struct memory_block *mem, void *arg)
  */
 int __ref add_memory_resource(int nid, struct resource *res)
 {
-       struct mhp_restrictions restrictions = {};
+       struct mhp_params params = { .pgprot = PAGE_KERNEL };
        u64 start, size;
        bool new_node = false;
        int ret;
@@ -1030,7 +1033,7 @@ int __ref add_memory_resource(int nid, struct resource *res)
        new_node = ret;
 
        /* call arch's memory hotadd */
-       ret = arch_add_memory(nid, start, size, &restrictions);
+       ret = arch_add_memory(nid, start, size, &params);
        if (ret < 0)
                goto error;