lkml.org 
[lkml]   [2021]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH -mmotm] mm/memory_hotplug: fix for CONFIG_ZONE_DEVICE not enabled
From
Date
From: Randy Dunlap <rdunlap@infradead.org>

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 <rdunlap@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dan Williams <dan.j.williams@intel.com>
---
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
\
 
 \ /
  Last update: 2021-01-20 04:07    [W:0.044 / U:1.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site