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 | int sections_to_remove; | 557 | int sections_to_remove; |
| 558 | 558 | ||
| 559 | /* In the ZONE_DEVICE case device driver owns the memory region */ | 559 | /* In the ZONE_DEVICE case device driver owns the memory region */ |
| 560 | if (is_dev_zone(zone)) { | 560 | if (is_dev_zone(zone)) |
| 561 | if (altmap) | 561 | map_offset = vmem_altmap_offset(altmap); |
| 562 | map_offset = vmem_altmap_offset(altmap); | ||
| 563 | } | ||
| 564 | 562 | ||
| 565 | clear_zone_contiguous(zone); | 563 | clear_zone_contiguous(zone); |
| 566 | 564 | ||