diff options
| author | Dave Airlie <airlied@redhat.com> | 2019-02-18 13:27:15 +1000 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2019-02-18 13:27:15 +1000 |
| commit | c06de56121e3ac0f0f1f4a081c041654ffcacd62 (patch) | |
| tree | 3662e7052352b0f1b78e8832b1d3b91ca211b798 /include/linux/memory_hotplug.h | |
| parent | 8d451a4b6e9f4b52ae3d4cafe17486d8d0c6afb0 (diff) | |
| parent | a3b22b9f11d9fbc48b0291ea92259a5a810e9438 (diff) | |
Merge v5.0-rc7 into drm-next
Backmerging for nouveau and imx that needed some fixes for next pulls.
Signed-off-by: Dave Airlie <airlied@redhat.com>
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; * walkers which rely on the fully initialized page->flags and others * should use this rather than pfn_valid && pfn_to_page */ -#define pfn_to_online_page(pfn) \ -({ \ - struct page *___page = NULL; \ - unsigned long ___nr = pfn_to_section_nr(pfn); \ - \ - if (___nr < NR_MEM_SECTIONS && online_section_nr(___nr))\ - ___page = pfn_to_page(pfn); \ - ___page; \ +#define pfn_to_online_page(pfn) \ +({ \ + struct page *___page = NULL; \ + unsigned long ___pfn = pfn; \ + unsigned long ___nr = pfn_to_section_nr(___pfn); \ + \ + if (___nr < NR_MEM_SECTIONS && online_section_nr(___nr) && \ + pfn_valid_within(___pfn)) \ + ___page = pfn_to_page(___pfn); \ + ___page; \ }) /* |
