Skip to contentSkip to conversation

mm_types.h: change set_page_private to inline function

PATCH Applied Guoqing Jiang 1 participant 1 message May 25, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm_types.h: change set_page_private to inline function

Change it to inline function to make callers use the proper argument. And no need for it to be macro per Andrew's comment [1].

[1] https://lore.kernel.org/lkml/[email protected]/

---
 include/linux/mm_types.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
include/linux/mm_types.h +5 -1
index e88dc5c65c01..64ede5f150dc 100644
@@ -240,7 +240,11 @@ static inline atomic_t *compound_pincount_ptr(struct page *page)
 #define PAGE_FRAG_CACHE_MAX_ORDER	get_order(PAGE_FRAG_CACHE_MAX_SIZE)
 
 #define page_private(page)		((page)->private)
-#define set_page_private(page, v)	((page)->private = (v))
+
+static inline void set_page_private(struct page *page, unsigned long private)
+{
+	page->private = private;
+}
 
 struct page_frag_cache {
 	void * va;
Signature · 1 line
2.17.1