diff options
Diffstat (limited to 'include/linux/mmzone.h')
| -rw-r--r-- | include/linux/mmzone.h | 11 | 
1 files changed, 9 insertions, 2 deletions
| diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 356a814e7c8e..c9c4a81b9767 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */  #ifndef _LINUX_MMZONE_H  #define _LINUX_MMZONE_H @@ -1094,8 +1095,14 @@ static inline unsigned long early_pfn_to_nid(unsigned long pfn)  #error Allocator MAX_ORDER exceeds SECTION_SIZE  #endif -#define pfn_to_section_nr(pfn) ((pfn) >> PFN_SECTION_SHIFT) -#define section_nr_to_pfn(sec) ((sec) << PFN_SECTION_SHIFT) +static inline unsigned long pfn_to_section_nr(unsigned long pfn) +{ +	return pfn >> PFN_SECTION_SHIFT; +} +static inline unsigned long section_nr_to_pfn(unsigned long sec) +{ +	return sec << PFN_SECTION_SHIFT; +}  #define SECTION_ALIGN_UP(pfn)	(((pfn) + PAGES_PER_SECTION - 1) & PAGE_SECTION_MASK)  #define SECTION_ALIGN_DOWN(pfn)	((pfn) & PAGE_SECTION_MASK) |