diff options
| author | Maxime Ripard <maxime.ripard@bootlin.com> | 2019-02-19 11:17:05 +0100 |
|---|---|---|
| committer | Maxime Ripard <maxime.ripard@bootlin.com> | 2019-02-19 11:17:05 +0100 |
| commit | ae6ba10d5090fc7e9095eaef3dcf06ba016725a6 (patch) | |
| tree | e631eaa2df52712783acc4d757841da4890c4143 /include/linux/memory_hotplug.h | |
| parent | e6049cf122d1568d8000c7f5bd52c99de07ecc65 (diff) | |
| parent | c06de56121e3ac0f0f1f4a081c041654ffcacd62 (diff) | |
Merge drm/drm-next into drm-misc-next
Backmerge drm-next to bring in -rc7
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.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; \ }) /* |
