diff options
Diffstat (limited to 'include/linux/memory_hotplug.h')
| -rw-r--r-- | include/linux/memory_hotplug.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 07da5c6c5ba0..368267c1b71b 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
| @@ -21,14 +21,16 @@ struct vmem_altmap; | |||
| 21 | * walkers which rely on the fully initialized page->flags and others | 21 | * walkers which rely on the fully initialized page->flags and others |
| 22 | * should use this rather than pfn_valid && pfn_to_page | 22 | * should use this rather than pfn_valid && pfn_to_page |
| 23 | */ | 23 | */ |
| 24 | #define pfn_to_online_page(pfn) \ | 24 | #define pfn_to_online_page(pfn) \ |
| 25 | ({ \ | 25 | ({ \ |
| 26 | struct page *___page = NULL; \ | 26 | struct page *___page = NULL; \ |
| 27 | unsigned long ___nr = pfn_to_section_nr(pfn); \ | 27 | unsigned long ___pfn = pfn; \ |
| 28 | \ | 28 | unsigned long ___nr = pfn_to_section_nr(___pfn); \ |
| 29 | if (___nr < NR_MEM_SECTIONS && online_section_nr(___nr))\ | 29 | \ |
| 30 | ___page = pfn_to_page(pfn); \ | 30 | if (___nr < NR_MEM_SECTIONS && online_section_nr(___nr) && \ |
| 31 | ___page; \ | 31 | pfn_valid_within(___pfn)) \ |
| 32 | ___page = pfn_to_page(___pfn); \ | ||
| 33 | ___page; \ | ||
| 32 | }) | 34 | }) |
| 33 | 35 | ||
| 34 | /* | 36 | /* |
