From: Randy Dunlap <[email protected]>

Fix memory_hotplug.c when CONFIG_ZONE_DEVICE is not enabled.

Fixes this build error:

../mm/memory_hotplug.c: In function ‘move_pfn_range_to_zone’:
../mm/memory_hotplug.c:772:24: error: ‘ZONE_DEVICE’ undeclared (first use in 
this function); did you mean ‘ZONE_MOVABLE’?
  if (zone_idx(zone) == ZONE_DEVICE) {

Signed-off-by: Randy Dunlap <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Dan Williams <[email protected]>
---
 mm/memory_hotplug.c |    2 ++
 1 file changed, 2 insertions(+)

--- mmotm-2021-0119-1336.orig/mm/memory_hotplug.c
+++ mmotm-2021-0119-1336/mm/memory_hotplug.c
@@ -769,12 +769,14 @@ void __ref move_pfn_range_to_zone(struct
         * ZONE_DEVICE pages in an otherwise  ZONE_{NORMAL,MOVABLE}
         * section.
         */
+#ifdef CONFIG_ZONE_DEVICE
        if (zone_idx(zone) == ZONE_DEVICE) {
                if (!IS_ALIGNED(start_pfn, PAGES_PER_SECTION))
                        section_taint_zone_device(start_pfn);
                if (!IS_ALIGNED(start_pfn + nr_pages, PAGES_PER_SECTION))
                        section_taint_zone_device(start_pfn + nr_pages);
        }
+#endif
 
        /*
         * TODO now we have a visible range of pages which are not associated

Reply via email to