Add a flags field to struct dev_pagemap to replace the altmap_valid boolean to be a little more extensible. Also add a pgmap_altmap() helper to find the optional altmap and clean up the code using the altmap using it.
Showing the changes to mm/memory_hotplug.c (1 of 9 files). Show all
Unified · Split
| @@ -557,10 +557,8 @@ void __remove_pages(struct zone *zone, unsigned long phys_start_pfn, · 556 unmodified lines | ||
| 557 | 557 | int sections_to_remove; |
| 558 | 558 | |
| 559 | 559 | /* In the ZONE_DEVICE case device driver owns the memory region */ |
| 560 | − if (is_dev_zone(zone)) { | |
| 561 | − if (altmap) | |
| 562 | − map_offset = vmem_altmap_offset(altmap); | |
| 563 | − } | |
| 560 | + if (is_dev_zone(zone)) | |
| 561 | + map_offset = vmem_altmap_offset(altmap); | |
| 564 | 562 | |
| 565 | 563 | clear_zone_contiguous(zone); |
| 566 | 564 | |